Skip to content

Commit 7e8aa04

Browse files
thomasmeytorvalds
authored andcommitted
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: Thomas Meyer <[email protected]> Cc: Niranjana Vishwanathapura <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 30ecad5 commit 7e8aa04

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

drivers/char/msm_smd_pkt.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,9 +379,8 @@ static int __init smd_pkt_init(void)
379379
for (i = 0; i < NUM_SMD_PKT_PORTS; ++i) {
380380
smd_pkt_devp[i] = kzalloc(sizeof(struct smd_pkt_dev),
381381
GFP_KERNEL);
382-
if (IS_ERR(smd_pkt_devp[i])) {
383-
r = PTR_ERR(smd_pkt_devp[i]);
384-
pr_err("kmalloc() failed %d\n", r);
382+
if (!smd_pkt_devp[i]) {
383+
pr_err("kmalloc() failed\n");
385384
goto clean_cdevs;
386385
}
387386

0 commit comments

Comments
 (0)