]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Staging: bcm: Fix semaphore locking bug in, IOCTL_BCM_BUFFER_DOWNLOAD
authorKevin McKinney <klmckinney1@gmail.com>
Wed, 23 Nov 2011 01:25:56 +0000 (20:25 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sun, 27 Nov 2011 01:14:48 +0000 (17:14 -0800)
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 <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/bcm/Bcmchar.c

index 1bf28c95ef8584134a0e025fd5f550153e43dbad..5a3e7c846a3e076b06fdc902a122818a78b1ff42 100644 (file)
@@ -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;
                }