diff options
author | np <np@FreeBSD.org> | 2012-12-21 19:28:17 +0000 |
---|---|---|
committer | np <np@FreeBSD.org> | 2012-12-21 19:28:17 +0000 |
commit | cd0363b24b051261804e98b52f52212d3dbcfe3a (patch) | |
tree | 8a4145ffa4daafa4fe8589a35efb19ef21bb9f4d | |
parent | 10fd5103d05e0e84415fd9b26eebe9c98c8880fc (diff) | |
download | FreeBSD-src-cd0363b24b051261804e98b52f52212d3dbcfe3a.zip FreeBSD-src-cd0363b24b051261804e98b52f52212d3dbcfe3a.tar.gz |
cxgbe(4): must hold a write-lock on the table while allocating an L2
entry for switching.
MFC after: 3 days
-rw-r--r-- | sys/dev/cxgbe/t4_l2t.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/cxgbe/t4_l2t.c b/sys/dev/cxgbe/t4_l2t.c index 6476b9b..dd8748e 100644 --- a/sys/dev/cxgbe/t4_l2t.c +++ b/sys/dev/cxgbe/t4_l2t.c @@ -149,7 +149,7 @@ t4_l2t_alloc_switching(struct l2t_data *d) { struct l2t_entry *e; - rw_rlock(&d->lock); + rw_wlock(&d->lock); e = t4_alloc_l2e(d); if (e) { mtx_lock(&e->lock); /* avoid race with t4_l2t_free */ @@ -157,7 +157,7 @@ t4_l2t_alloc_switching(struct l2t_data *d) atomic_store_rel_int(&e->refcnt, 1); mtx_unlock(&e->lock); } - rw_runlock(&d->lock); + rw_wunlock(&d->lock); return e; } |