staging: wilc1000: wilc_msgqueue: release semaphore in error path
authorChaehyun Lim <chaehyun.lim@gmail.com>
Fri, 29 Jan 2016 14:51:33 +0000 (23:51 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Feb 2016 23:33:09 +0000 (15:33 -0800)
It should be called up(&mq->sem) to release semaphore before returning
error codes as -EFAULT when list is empty.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/wilc1000/wilc_msgqueue.c

index f57e4ec3c742308e7b4889aba0afcd29571793ba..5fe85eb40146226eeefd447476a8d127ac36f2ef 100644 (file)
@@ -126,6 +126,7 @@ int wilc_mq_recv(struct message_queue *mq,
 
        if (list_empty(&mq->msg_list)) {
                spin_unlock_irqrestore(&mq->lock, flags);
+               up(&mq->sem);
                PRINT_ER("msg is null\n");
                return -EFAULT;
        }