Skip to content

Commit

Permalink
drivers/char/msm_smd_pkt.c: don't use IS_ERR()
Browse files Browse the repository at this point in the history
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: Thomas Meyer <thomas@m3y3r.de>
Cc: Niranjana Vishwanathapura <nvishwan@codeaurora.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
thomasmey authored and torvalds committed Aug 25, 2011
1 parent 30ecad5 commit 7e8aa04
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/char/msm_smd_pkt.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,8 @@ static int __init smd_pkt_init(void)
for (i = 0; i < NUM_SMD_PKT_PORTS; ++i) {
smd_pkt_devp[i] = kzalloc(sizeof(struct smd_pkt_dev),
GFP_KERNEL);
if (IS_ERR(smd_pkt_devp[i])) {
r = PTR_ERR(smd_pkt_devp[i]);
pr_err("kmalloc() failed %d\n", r);
if (!smd_pkt_devp[i]) {
pr_err("kmalloc() failed\n");
goto clean_cdevs;
}

Expand Down

0 comments on commit 7e8aa04

Please sign in to comment.