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 <[email protected]>
---
 drivers/staging/bcm/Bcmchar.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/bcm/Bcmchar.c b/drivers/staging/bcm/Bcmchar.c
index 5d959ff..36a0f29 100644
--- a/drivers/staging/bcm/Bcmchar.c
+++ b/drivers/staging/bcm/Bcmchar.c
@@ -773,6 +773,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;
                }
-- 
1.7.4.1

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel

Reply via email to