From: Chandra S Gorentla <csgorentla@gmail.com>
To: gregkh@linuxfoundation.org
Cc: johnny.kim@atmel.com, rachel.kim@atmel.com, chris.park@atmel.com,
linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org,
linux-kernel@vger.kernel.org, dan.carpenter@oracle.com,
Chandra S Gorentla <csgorentla@gmail.com>
Subject: [PATCH 3/3] drivers: staging: wilc1000: Do not return from function with lock is on
Date: Fri, 2 Oct 2015 18:47:37 +0530 [thread overview]
Message-ID: <1443791857-7837-3-git-send-email-csgorentla@gmail.com> (raw)
In-Reply-To: <1443791857-7837-2-git-send-email-csgorentla@gmail.com>
There are a couple of return statements before unlock. Lock is moved
to a location just before queue manipulation.
Signed-off-by: Chandra S Gorentla <csgorentla@gmail.com>
---
drivers/staging/wilc1000/wilc_msgqueue.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/wilc1000/wilc_msgqueue.c b/drivers/staging/wilc1000/wilc_msgqueue.c
index a9c28ad..2fa3792 100644
--- a/drivers/staging/wilc1000/wilc_msgqueue.c
+++ b/drivers/staging/wilc1000/wilc_msgqueue.c
@@ -72,8 +72,6 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle,
goto ERRORHANDLER;
}
- spin_lock_irqsave(&pHandle->strCriticalSection, flags);
-
/* construct a new message */
pstrMessage = kmalloc(sizeof(Message), GFP_ATOMIC);
if (!pstrMessage)
@@ -88,6 +86,8 @@ int wilc_mq_send(WILC_MsgQueueHandle *pHandle,
memcpy(pstrMessage->pvBuffer, pvSendBuffer, u32SendBufferSize);
/* add it to the message queue */
+ spin_lock_irqsave(&pHandle->strCriticalSection, flags);
+
if (!pHandle->pstrMessageList) {
pHandle->pstrMessageList = pstrMessage;
} else {
--
2.1.4
next prev parent reply other threads:[~2015-10-02 13:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-02 13:17 [PATCH 1/3] drivers: staging: wilc1000: Check for errors before kfree Chandra S Gorentla
2015-10-02 13:17 ` [PATCH 2/3] drivers: staging: wilc1000: Remove ineffective code Chandra S Gorentla
2015-10-02 13:17 ` Chandra S Gorentla [this message]
2015-10-02 13:39 ` [PATCH 1/3] drivers: staging: wilc1000: Check for errors before kfree Dan Carpenter
2015-10-03 2:11 ` Chandra Gorentla
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1443791857-7837-3-git-send-email-csgorentla@gmail.com \
--to=csgorentla@gmail.com \
--cc=chris.park@atmel.com \
--cc=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=johnny.kim@atmel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=rachel.kim@atmel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®