mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-24 09:13:20 -05:00
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>
This commit is contained in:
parent
50b19729ce
commit
951842b054
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue