staging: wilc1000: wilc_msgqueue: release semaphore in error path

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>
This commit is contained in:
Chaehyun Lim 2016-01-29 23:51:33 +09:00 committed by Greg Kroah-Hartman
parent e9670aba93
commit 8231dfc087
1 changed files with 1 additions and 0 deletions

View 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;
}