patch: new patch pattern kfree_for_devm_kzalloc.cocci

remove kfree for memory allocated with devm_kzalloc

It's not necessary to free memory allocated with devm_kzalloc
and using kfree leads to a double free.

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
patch: new patch pattern devm_ioremap_res_errmsg.cocci

remove redundant dev_err call in {{function}}

There is a error message within devm_ioremap_resource
already, so remove the dev_err call to avoid redundant
error message.

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
patch: new patch pattern free_netdev_leak.cocci

add missing free_netdev() on error in {{function}}

Add the missing free_netdev() before return from function
{{function}} in the error handling case.

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
patch: new patch pattern of_clk_get_by_name__ret.cocci

fix return value check in {{function}}

In case of error, function of_clk_get_by_name() returns
ERR_PTR() never returns NULL. The NULL test in the return
value check should be replaced with IS_ERR().

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
patch: new patch pattern sock_alloc_file__ret.cocci

fix return value check in {{function}}

In case of error, the function sock_alloc_file() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check
should be replaced with IS_ERR().

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
patch: new patch pattern struct_module_field_leak.cocci

add missing {{newfield}} to {{struct}}

Add missing {{newfield}} of {{struct}}. This prevents the
module from being removed from underneath its users.

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
patch: new patch pattern snd_soc_card_owner_leak.cocci

add .owner to struct snd_soc_card

Add missing .owner of struct snd_soc_card. This prevents the
module from being removed from underneath its users.

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
patch: new patch pattern free_irq_mismatch.cocci

fix to pass correct device identity to free_irq()

free_irq() expects the same device identity that was passed to
corresponding request_irq(), otherwise the IRQ is not freed.

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
report: new report pattern ERR_PTR_RET_CHK.cocci

fix return value check in {{function}}

In case of error, the function XXXX() returns ERR_PTR()
and never returns NULL. The NULL test in the return value check
should be replaced with IS_ERR().

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
patterns: update to 20130703

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>