]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
drivers/net/ns83820.c: fix a check-after-use
authorAdrian Bunk <bunk@stusta.de>
Sun, 1 Jul 2007 20:21:10 +0000 (22:21 +0200)
committerJeff Garzik <jeff@garzik.org>
Mon, 2 Jul 2007 12:24:52 +0000 (08:24 -0400)
This patch fixes a check-after-use spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/ns83820.c

index 717d8e9b98332ab4a59256079005c3560cedb141..104aab3c957f684edd3f751f86db89a89b5052a3 100644 (file)
@@ -1831,11 +1831,13 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_
 
        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);