Skip to content

Commit a09f4af

Browse files
musicakcdavem330
authored andcommitted
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>
1 parent a813104 commit a09f4af

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎drivers/net/ethernet/amd/lance.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -547,8 +547,8 @@ static int __init lance_probe1(struct net_device *dev, int ioaddr, int irq, int
547547
/* Make certain the data structures used by the LANCE are aligned and DMAble. */
548548

549549
lp = kzalloc(sizeof(*lp), GFP_DMA | GFP_KERNEL);
550-
if(lp==NULL)
551-
return -ENODEV;
550+
if (!lp)
551+
return -ENOMEM;
552552
if (lance_debug > 6) printk(" (#0x%05lx)", (unsigned long)lp);
553553
dev->ml_priv = lp;
554554
lp->name = chipname;

0 commit comments

Comments
 (0)