Skip to contentSkip to conversation

drivers/net/ns83820.c: fix a check-after-use

PATCH Applied Adrian Bunk 2 participants 2 messages Jul 1, 2007 – Jul 2, 2007

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

PATCH 1/1 drivers/net/ns83820.c: fix a check-after-use

This patch fixes a check-after-use spotted by the Coverity checker.

---

drivers/net/ns83820.c renamed from drivers/net/ns83820.c.old +3 -1
@@ -1985,11 +1985,13 @@ static int __devinit ns83820_init_one(st
 
 	ndev = alloc_etherdev(sizeof(struct ns83820));
 	dev = PRIV(ndev);
-	dev->ndev = ndev;
+
 	err = -ENOMEM;
 	if (!dev)
 		goto out;
 
+	dev->ndev = ndev;
+
 	spin_lock_init(&dev->rx_info.lock);
 	spin_lock_init(&dev->tx_lock);
 	spin_lock_init(&dev->misc_lock);