summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjmg <jmg@FreeBSD.org>2004-11-15 22:24:32 +0000
committerjmg <jmg@FreeBSD.org>2004-11-15 22:24:32 +0000
commit4cdb4f64c1ef1e97a0361a30c29c148d31a889a8 (patch)
tree0f1af5a8ee03d1748982400bb8e96dc06598542f /sys
parent1329297d102b81e882d6f496ee681e698bc7f619 (diff)
downloadFreeBSD-src-4cdb4f64c1ef1e97a0361a30c29c148d31a889a8.zip
FreeBSD-src-4cdb4f64c1ef1e97a0361a30c29c148d31a889a8.tar.gz
move the lock after the NULL check so we don't have a hard(er) to diagnose
panic... Pointed out by: Bjoern A. Zeeb
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/sk/if_sk.c4
-rw-r--r--sys/pci/if_sk.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/sk/if_sk.c b/sys/dev/sk/if_sk.c
index 2bc4f15..d1ce5ac 100644
--- a/sys/dev/sk/if_sk.c
+++ b/sys/dev/sk/if_sk.c
@@ -1106,11 +1106,11 @@ sk_jfree(buf, args)
/* Extract the softc struct pointer. */
sc_if = (struct sk_if_softc *)args;
- SK_IF_LOCK(sc_if);
-
if (sc_if == NULL)
panic("sk_jfree: didn't get softc pointer!");
+ SK_IF_LOCK(sc_if);
+
/* calculate the slot this buffer belongs to */
i = ((vm_offset_t)buf
- (vm_offset_t)sc_if->sk_cdata.sk_jumbo_buf) / SK_JLEN;
diff --git a/sys/pci/if_sk.c b/sys/pci/if_sk.c
index 2bc4f15..d1ce5ac 100644
--- a/sys/pci/if_sk.c
+++ b/sys/pci/if_sk.c
@@ -1106,11 +1106,11 @@ sk_jfree(buf, args)
/* Extract the softc struct pointer. */
sc_if = (struct sk_if_softc *)args;
- SK_IF_LOCK(sc_if);
-
if (sc_if == NULL)
panic("sk_jfree: didn't get softc pointer!");
+ SK_IF_LOCK(sc_if);
+
/* calculate the slot this buffer belongs to */
i = ((vm_offset_t)buf
- (vm_offset_t)sc_if->sk_cdata.sk_jumbo_buf) / SK_JLEN;
OpenPOWER on IntegriCloud