提交 7e8aa048 编写于 作者: T Thomas Meyer 提交者: Linus Torvalds

drivers/char/msm_smd_pkt.c: don't use IS_ERR()

The various basic memory allocation function return NULL, not an
ERR_PTR.

The semantic patch that makes this change is available in
scripts/coccinelle/null/eno.cocci.

More information about semantic patching is available at
http://coccinelle.lip6.fr/Signed-off-by: NThomas Meyer <thomas@m3y3r.de>
Cc: Niranjana Vishwanathapura <nvishwan@codeaurora.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 30ecad51
...@@ -379,9 +379,8 @@ static int __init smd_pkt_init(void) ...@@ -379,9 +379,8 @@ static int __init smd_pkt_init(void)
for (i = 0; i < NUM_SMD_PKT_PORTS; ++i) { for (i = 0; i < NUM_SMD_PKT_PORTS; ++i) {
smd_pkt_devp[i] = kzalloc(sizeof(struct smd_pkt_dev), smd_pkt_devp[i] = kzalloc(sizeof(struct smd_pkt_dev),
GFP_KERNEL); GFP_KERNEL);
if (IS_ERR(smd_pkt_devp[i])) { if (!smd_pkt_devp[i]) {
r = PTR_ERR(smd_pkt_devp[i]); pr_err("kmalloc() failed\n");
pr_err("kmalloc() failed %d\n", r);
goto clean_cdevs; goto clean_cdevs;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册