Skip to contentSkip to conversation

Staging: wlags49_h2: potential NULL dereference

PATCH New Dan Carpenter 1 participant 1 message May 14, 2012

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

PATCH 1/1 Staging: wlags49_h2: potential NULL dereference

wl_device_dealloc() dereferences the "dev" paramter, so let's move it under the check for NULL.

---
Static checker stuff. I don't know if "dev" can actually be NULL here.

drivers/staging/wlags49_h2/wl_cs.c +1 -2
index 7084f41..7c7c77f 100644
@@ -177,10 +177,9 @@ static void wl_adapter_detach(struct pcmcia_device *link)
 	if (dev) {
 		unregister_wlags_sysfs(dev);
 		unregister_netdev(dev);
+		wl_device_dealloc(dev);
 	}
 
-	wl_device_dealloc(dev);
-
 	DBG_LEAVE(DbgInfo);
 } /* wl_adapter_detach */
 /*======================================*/