From: Kevin McKinney Date: Wed, 23 Nov 2011 01:25:56 +0000 (-0500) Subject: Staging: bcm: Fix semaphore locking bug in, IOCTL_BCM_BUFFER_DOWNLOAD X-Git-Tag: next-20111128~7^2~102 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=abe33fc0933f9221193fc047fbf93cf9db23c8f6;p=karo-tx-linux.git 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 --- diff --git a/drivers/staging/bcm/Bcmchar.c b/drivers/staging/bcm/Bcmchar.c index 1bf28c95ef85..5a3e7c846a3e 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; }