Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

lance: Return correct error code

Failure of kzalloc should cause the enclosing function
to return -ENOMEM, not -ENODEV.

Additionally, removed the following checkpatch warnings:
ERROR: spaces required around that '==' (ctx:VxV)
ERROR: space required before the open parenthesis '('
CHECK: Comparison to NULL could be written "!lp"

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Amitoj Kaur Chawla and committed by
David S. Miller
a09f4af1 a813104d

+2 -2
+2 -2
drivers/net/ethernet/amd/lance.c
··· 547 547 /* Make certain the data structures used by the LANCE are aligned and DMAble. */ 548 548 549 549 lp = kzalloc(sizeof(*lp), GFP_DMA | GFP_KERNEL); 550 - if(lp==NULL) 551 - return -ENODEV; 550 + if (!lp) 551 + return -ENOMEM; 552 552 if (lance_debug > 6) printk(" (#0x%05lx)", (unsigned long)lp); 553 553 dev->ml_priv = lp; 554 554 lp->name = chipname;