summaryrefslogtreecommitdiffstats
path: root/sys/dev/wi/if_wi.c
diff options
context:
space:
mode:
authoravatar <avatar@FreeBSD.org>2007-08-09 13:29:26 +0000
committeravatar <avatar@FreeBSD.org>2007-08-09 13:29:26 +0000
commit3e954dbc055d1799a92b99f305a9becfeec7a491 (patch)
treece87b60b8aa83d2c18c51c6bf9cf0e2dce022eb8 /sys/dev/wi/if_wi.c
parent134f3ad3d31d78a7dad40bc6160d9048c1b82552 (diff)
downloadFreeBSD-src-3e954dbc055d1799a92b99f305a9becfeec7a491.zip
FreeBSD-src-3e954dbc055d1799a92b99f305a9becfeec7a491.tar.gz
MFP4(123963): Fixing a possible NULL pointer dereference by making
the actual assignment after the NULL check. Found by: Coverity Prevent(tm) CID: 2303 (run 4156) Reviewed by: sam Approved by: re (bmah)
Diffstat (limited to 'sys/dev/wi/if_wi.c')
-rw-r--r--sys/dev/wi/if_wi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/wi/if_wi.c b/sys/dev/wi/if_wi.c
index e9dfad3..efa7e4a 100644
--- a/sys/dev/wi/if_wi.c
+++ b/sys/dev/wi/if_wi.c
@@ -267,12 +267,12 @@ wi_attach(device_t dev)
int error;
ifp = sc->sc_ifp = if_alloc(IFT_ETHER);
- ifp->if_softc = sc;
if (ifp == NULL) {
device_printf(dev, "can not if_alloc\n");
wi_free(dev);
return (ENOSPC);
}
+ ifp->if_softc = sc;
/*
* NB: no locking is needed here; don't put it here
OpenPOWER on IntegriCloud