From abe33fc0933f9221193fc047fbf93cf9db23c8f6 Mon Sep 17 00:00:00 2001 From: Kevin McKinney Date: Tue, 22 Nov 2011 20:25:56 -0500 Subject: [PATCH] Staging: bcm: Fix semaphore locking bug in, IOCTL_BCM_BUFFER_DOWNLOAD In this ioctl, we are testing to see if the lock is held. If it is not held, that means this ioctl used incorrectly. Therefore, we do not want to take the lock ourselves here. Signed-off-by: Kevin McKinney Signed-off-by: Greg Kroah-Hartman --- drivers/staging/bcm/Bcmchar.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/bcm/Bcmchar.c b/drivers/staging/bcm/Bcmchar.c index 1bf28c95ef8..5a3e7c846a3 100644 --- a/drivers/staging/bcm/Bcmchar.c +++ b/drivers/staging/bcm/Bcmchar.c @@ -796,6 +796,7 @@ cntrlEnd: if (!down_trylock(&Adapter->fw_download_sema)) { BCM_DEBUG_PRINT(Adapter, DBG_TYPE_PRINTK, 0, 0, "Invalid way to download buffer. Use Start and then call this!!!\n"); + up(&Adapter->fw_download_sema); Status = -EINVAL; break; } -- 2.39.5