summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/amd/lance.c
diff options
context:
space:
mode:
authorAmitoj Kaur Chawla <amitoj1606@gmail.com>2016-02-17 16:03:26 +0100
committerDavid S. Miller <davem@davemloft.net>2016-02-18 20:58:47 +0100
commita09f4af177d2a5b7dc424aba6ba808f4a674ce81 (patch)
tree9233aa47dcf8d8b512eab13565bd0ce711600446 /drivers/net/ethernet/amd/lance.c
parentIFF_NO_QUEUE: Fix for drivers not calling ether_setup() (diff)
downloadlinux-a09f4af177d2a5b7dc424aba6ba808f4a674ce81.tar.xz
linux-a09f4af177d2a5b7dc424aba6ba808f4a674ce81.zip
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>
Diffstat (limited to 'drivers/net/ethernet/amd/lance.c')
-rw-r--r--drivers/net/ethernet/amd/lance.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/amd/lance.c b/drivers/net/ethernet/amd/lance.c
index 256f590f6bb1..3a7ebfdda57d 100644
--- a/drivers/net/ethernet/amd/lance.c
+++ b/drivers/net/ethernet/amd/lance.c
@@ -547,8 +547,8 @@ static int __init lance_probe1(struct net_device *dev, int ioaddr, int irq, int
/* Make certain the data structures used by the LANCE are aligned and DMAble. */
lp = kzalloc(sizeof(*lp), GFP_DMA | GFP_KERNEL);
- if(lp==NULL)
- return -ENODEV;
+ if (!lp)
+ return -ENOMEM;
if (lance_debug > 6) printk(" (#0x%05lx)", (unsigned long)lp);
dev->ml_priv = lp;
lp->name = chipname;