lkml.org 
[lkml]   [2018]   [Jan]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH -next] um: vector: fix missing unlock on error in vector_net_open()
Date
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);
\
 
 \ /
  Last update: 2018-01-05 08:18    [W:0.028 / U:0.580 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site