Category: Linux

ALSA: fix possible memory leak in snd_mixer_oss_build_input()

Author: Wei Yongjun <yongjun_wei@trendmicro.com.cn> uinfo has been allocated in this function and should be freed before leaving from the error handling cases. spatch with a semantic match is used to found this problem. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun Signed-off-by: Takashi Iwai — sound/core/oss/mixer_oss.c | 2 ++ 1 file changed, 2 insertions(+)   diff –git a/sound/core/oss/mixer_oss.c b/sound/core/oss/mixer_oss.c …

Continue reading

Btrfs: fix possible memory leak in scrub_setup_recheck_block()

Author: Wei Yongjun <yongjun_wei@trendmicro.com.cn> bbio has been malloced in btrfs_map_block() and should be freed before leaving from the error handling cases. spatch with a semantic match is used to found this problem. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun — fs/btrfs/scrub.c | 1 + 1 file changed, 1 insertion(+)   diff –git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c index b223620..4e9eafe 100644 — …

Continue reading

nl80211: fix possible memory leak nl80211_connect()

Author: Wei Yongjun <yongjun_wei@trendmicro.com.cn> connkeys is malloced in nl80211_parse_connkeys() and should be freed in the error handling case, otherwise it will cause memory leak. spatch with a semantic match is used to found this problem. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun Signed-off-by: Johannes Berg — net/wireless/nl80211.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)   …

Continue reading

NFC: Fix possible LLCP memory leak

Author: Wei Yongjun <yongjun_wei@trendmicro.com.cn> nfc_llcp_build_tlv() malloced the memory and should be free in nfc_llcp_build_gb() after used, and the same in the error handling case, otherwise it will cause memory leak. spatch with a semantic match is used to found this problem. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun Signed-off-by: Samuel Ortiz — net/nfc/llcp/llcp.c | 14 +++++++++—– 1 file …

Continue reading

drivers/tty/serial/sirfsoc_uart.c: drop frees of devm_ alloc’d data

Author: Julia Lawall <Julia.Lawall@lip6.fr> devm free functions should not have to be explicitly used. A semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ @@ ( * devm_kfree(…); | * devm_free_irq(…); | * devm_iounmap(…); | * devm_release_region(…); | * devm_release_mem_region(…); ) // Signed-off-by: Julia Lawall Signed-off-by: Greg Kroah-Hartman — drivers/tty/serial/sirfsoc_uart.c | 8 …

Continue reading

spi: spi-sh-hspi: drop frees of devm_ alloc’d data

Author: Julia Lawall <Julia.Lawall@lip6.fr> devm free functions should not have to be explicitly used. A semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ @@ ( * devm_kfree(…); | * devm_free_irq(…); | * devm_iounmap(…); | * devm_release_region(…); | * devm_release_mem_region(…); ) // Signed-off-by: Julia Lawall Signed-off-by: Mark Brown — drivers/spi/spi-sh-hspi.c | 5 …

Continue reading

ASoC: wm0010: Add missing IRQF_ONESHOT

Author: Fengguang Wu <fengguang.wu@intel.com> FYI, there are new coccinelle warnings show up in tree: git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-3.7 head: e3523e01869da20fdd12ffd19ae1df7bf492650e commit: e3523e01869da20fdd12ffd19ae1df7bf492650e [95/95] ASoC: wm0010: Add initial wm0010 DSP driver All coccinelle warnings: + sound/soc/codecs/wm0010.c:850:7-27: ERROR: Threaded IRQ with no primary handler requested without IRQF_ONESHOT — + sound/soc/codecs/wm0010.c:660:1-7: preceding lock on line 359 vim +850 sound/soc/codecs/wm0010.c 847 …

Continue reading

netfilter: nfnetlink_log: fix error return code in init path

Author: Julia Lawall <Julia.Lawall@lip6.fr> Initialize return variable before exiting on an error path. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // ( if@p1 (\(ret < 0\|ret != 0\)) { ... return ret; } | ret@p1 = 0 ) ... when != ret = e1 when != &ret …

Continue reading

netfilter: ctnetlink: fix error return code in init path

Author: Julia Lawall <Julia.Lawall@lip6.fr> Initialize return variable before exiting on an error path. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // ( if@p1 (\(ret < 0\|ret != 0\)) { ... return ret; } | ret@p1 = 0 ) ... when != ret = e1 when != &ret …

Continue reading

net/xfrm/xfrm_state.c: fix error return code

Author: Julia Lawall <Julia.Lawall@lip6.fr> Initialize return variable before exiting on an error path. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // ( if@p1 (\(ret < 0\|ret != 0\)) { ... return ret; } | ret@p1 = 0 ) ... when != ret = e1 when != &ret …

Continue reading