summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/dev/cxgbe/t4_l2t.c4
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;
}
OpenPOWER on IntegriCloud