kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] IB/hfi1: fix a locking bug
@ 2015-09-16  6:22 Dan Carpenter
  2015-09-18 15:51 ` Doug Ledford
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2015-09-16  6:22 UTC (permalink / raw)
  To: Mike Marciniszyn
  Cc: devel, linux-rdma, Greg Kroah-Hartman, kernel-janitors,
	Doug Ledford, Sean Hefty, Hal Rosenstock

mutex_trylock() returns zero on failure, not EBUSY.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/staging/rdma/hfi1/chip.c b/drivers/staging/rdma/hfi1/chip.c
index 654eafe..aa58e59 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);
 	}
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch] IB/hfi1: fix a locking bug
  2015-09-16  6:22 [patch] IB/hfi1: fix a locking bug Dan Carpenter
@ 2015-09-18 15:51 ` Doug Ledford
  0 siblings, 0 replies; 2+ messages in thread
From: Doug Ledford @ 2015-09-18 15:51 UTC (permalink / raw)
  To: Dan Carpenter, Mike Marciniszyn
  Cc: Sean Hefty, Hal Rosenstock, Greg Kroah-Hartman,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA,
	devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b,
	kernel-janitors-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 268 bytes --]

On 09/16/2015 02:22 AM, Dan Carpenter wrote:
> mutex_trylock() returns zero on failure, not EBUSY.
> 
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks, applied.


-- 
Doug Ledford <dledford@redhat.com>
              GPG KeyID: 0E572FDD



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-09-18 15:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-16  6:22 [patch] IB/hfi1: fix a locking bug Dan Carpenter
2015-09-18 15:51 ` Doug Ledford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).