Skip to contentSkip to conversation

skfp: testing the wrong variable in skfp_driver_init()

PATCH Applied Dan Carpenter 3 participants 3 messages Dec 24, 2010 – Dec 28, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

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.

drivers/net/skfp/skfddi.c +1 -1
index 0a66fed..16c6265 100644
@@ -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);
Reviewed-by on v1 1/1
#1 lore raw
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.

drivers/net/skfp/skfddi.c +0 -0
index 0a66fed..16c6265 100644

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.

maintainer Applied
#2 lore raw

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.

drivers/net/skfp/skfddi.c +0 -0
index 0a66fed..16c6265 100644

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.

Quoted 1 line

Applied, thanks.