summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2015-09-16 08:22:51 +0200
committerDoug Ledford <dledford@redhat.com>2015-09-18 17:28:47 +0200
commit951842b0540d2ed49ae29ba968adc496baf46556 (patch)
tree62a4d17e2063cf9a221098072a489413aaf95050 /drivers
parentIB/hfi1: checking for NULL instead of IS_ERR (diff)
downloadlinux-951842b0540d2ed49ae29ba968adc496baf46556.tar.xz
linux-951842b0540d2ed49ae29ba968adc496baf46556.zip
IB/hfi1: fix a locking bug
mutex_trylock() returns zero on failure, not EBUSY. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/rdma/hfi1/chip.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/rdma/hfi1/chip.c b/drivers/staging/rdma/hfi1/chip.c
index 654eafef1d30..aa58e597df06 100644
--- a/drivers/staging/rdma/hfi1/chip.c
+++ b/drivers/staging/rdma/hfi1/chip.c
@@ -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);
}