From: Wei Yongjun <weiyongjun1@huawei.com>
To: Jeff Dike <jdike@addtoit.com>,
Richard Weinberger <richard@nod.at>,
"Anton Ivanov" <anton.ivanov@cambridgegreys.com>
Cc: Wei Yongjun <weiyongjun1@huawei.com>,
<user-mode-linux-devel@lists.sourceforge.net>,
<user-mode-linux-user@lists.sourceforge.net>,
<linux-kernel@vger.kernel.org>
Subject: [PATCH -next] um: vector: fix missing unlock on error in vector_net_open()
Date: Fri, 5 Jan 2018 07:22:52 +0000 [thread overview]
Message-ID: <1515136972-58532-1-git-send-email-weiyongjun1@huawei.com> (raw)
Add the missing unlock before return from function vector_net_open()
in the error handling case.
Fixes: ad1f62ab2bd4 ("High Performance UML Vector Network Driver")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
arch/um/drivers/vector_kern.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c
index d1d5301..bb83a2d 100644
--- a/arch/um/drivers/vector_kern.c
+++ b/arch/um/drivers/vector_kern.c
@@ -1156,8 +1156,10 @@ static int vector_net_open(struct net_device *dev)
struct vector_device *vdevice;
spin_lock_irqsave(&vp->lock, flags);
- if (vp->opened)
+ if (vp->opened) {
+ spin_unlock_irqrestore(&vp->lock, flags);
return -ENXIO;
+ }
vp->opened = true;
spin_unlock_irqrestore(&vp->lock, flags);
next reply other threads:[~2018-01-05 7:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-05 7:22 Wei Yongjun [this message]
2018-01-05 10:12 ` Anton Ivanov
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=1515136972-58532-1-git-send-email-weiyongjun1@huawei.com \
--to=weiyongjun1@huawei.com \
--cc=anton.ivanov@cambridgegreys.com \
--cc=jdike@addtoit.com \
--cc=linux-kernel@vger.kernel.org \
--cc=richard@nod.at \
--cc=user-mode-linux-devel@lists.sourceforge.net \
--cc=user-mode-linux-user@lists.sourceforge.net \
/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®