skfp: testing the wrong variable in skfp_driver_init()
Subsystems (3)
PATCH 1/1 skfp: testing the wrong variable in skfp_driver_init()
The intent here was to test if the allocation failed but we tested "SharedMemSize" instead of "SharedMemAddr" by mistake.
Signed-off-by Dan Carpenter <[email protected]>
drivers/net/skfp/skfddi.c +1 -1
@@ -412,7 +412,7 @@ static int skfp_driver_init(struct net_device *dev) bp->SharedMemAddr =pci_alloc_consistent (&bp->pdev, bp->SharedMemSize, &bp->SharedMemDMA); -if (!bp->SharedMemSize) { +if (!bp->SharedMemAddr) {printk ("could not allocate mem for " );printk ("hardware module: %ld byte\n" , bp->SharedMemSize);
Quoted 10 lines · Fri, Dec 24, 2010 at 06:17:34AM CET, [email protected] wrote:
The intent here was to test if the allocation failed but we tested "SharedMemSize" instead of "SharedMemAddr" by mistake.
Signed-off-by Dan Carpenter <[email protected]>drivers/net/skfp/skfddi.c +0
-0
drivers/net/skfp/skfddi.c static int skfp_driver_init(struct net_device *dev) · line 418
Quoted 8 lines
drivers/net/skfp/skfddi.c +1
-1@@ -412,7 +412,7 @@ static int skfp_driver_init(struct net_device *dev) bp->SharedMemAddr =pci_alloc_consistent (&bp->pdev, bp->SharedMemSize, &bp->SharedMemDMA); -if (!bp->SharedMemSize) { +if (!bp->SharedMemAddr) {printk ("could not allocate mem for " );printk ("hardware module: %ld byte\n" , bp->SharedMemSize);
Looks obvious.
Reviewed-by Jiri Pirko <[email protected]>
From: Jiri Pirko <[email protected]>
Date: Fri, 24 Dec 2010 09:45:39 +0100
Quoted 22 lines
Quoted 10 lines · Fri, Dec 24, 2010 at 06:17:34AM CET, [email protected] wrote:
The intent here was to test if the allocation failed but we tested "SharedMemSize" instead of "SharedMemAddr" by mistake.
Signed-off-by Dan Carpenter <[email protected]>drivers/net/skfp/skfddi.c +0
-0drivers/net/skfp/skfddi.c static int skfp_driver_init(struct net_device *dev) · line 418
Quoted 8 lines
drivers/net/skfp/skfddi.c +1
-1@@ -412,7 +412,7 @@ static int skfp_driver_init(struct net_device *dev) bp->SharedMemAddr =pci_alloc_consistent (&bp->pdev, bp->SharedMemSize, &bp->SharedMemDMA); -if (!bp->SharedMemSize) { +if (!bp->SharedMemAddr) {printk ("could not allocate mem for " );printk ("hardware module: %ld byte\n" , bp->SharedMemSize);Looks obvious.
Quoted 1 line
Reviewed-by Jiri Pirko <[email protected]>
Applied, thanks.