IB/hfi1: fix a locking bug
Subsystems (3)
PATCH 1/1 IB/hfi1: fix a locking bug
mutex_trylock() returns zero on failure, not EBUSY.
Signed-off-by Dan Carpenter <[email protected]>
drivers/staging/rdma/hfi1/chip.c +2 -2
@@ -2710,7 +2710,7 @@ int acquire_lcb_access(struct hfi1_devdata *dd, int sleep_ok)if (sleep_ok) {mutex_lock (&ppd->hls_lock); }else { -while (mutex_trylock (&ppd->hls_lock) =EBUSY ) +while (!mutex_trylock (&ppd->hls_lock))udelay (1 ); }
@@ -2758,7 +2758,7 @@ int release_lcb_access(struct hfi1_devdata *dd, int sleep_ok)if (sleep_ok) {mutex_lock (&dd->pport->hls_lock); }else { -while (mutex_trylock (&dd->pport->hls_lock) =EBUSY ) +while (!mutex_trylock (&dd->pport->hls_lock))udelay (1 ); }
Doug Ledford
AppliedQuoted 3 lines · Dan Carpenter
mutex_trylock()returns zero on failure, not EBUSY.Signed-off-by Dan Carpenter <[email protected]>
Thanks, applied.
Signature · 2 lines
Doug Ledford <[email protected]> GPG KeyID: 0E572FDD