mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH -next] um: vector: fix missing unlock on error in vector_net_open()
@ 2018-01-05  7:22 Wei Yongjun
  2018-01-05 10:12 ` Anton Ivanov
  0 siblings, 1 reply; 2+ messages in thread
From: Wei Yongjun @ 2018-01-05  7:22 UTC (permalink / raw)
  To: Jeff Dike, Richard Weinberger, Anton Ivanov
  Cc: Wei Yongjun, user-mode-linux-devel, user-mode-linux-user, linux-kernel

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);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH -next] um: vector: fix missing unlock on error in vector_net_open()
  2018-01-05  7:22 [PATCH -next] um: vector: fix missing unlock on error in vector_net_open() Wei Yongjun
@ 2018-01-05 10:12 ` Anton Ivanov
  0 siblings, 0 replies; 2+ messages in thread
From: Anton Ivanov @ 2018-01-05 10:12 UTC (permalink / raw)
  To: Wei Yongjun, Jeff Dike, Richard Weinberger, dan.carpenter
  Cc: user-mode-linux-devel, user-mode-linux-user, linux-kernel

Hi Wei,

I just double-checked.

This issue has been fixed in a patch submitted by Dan Carpenter on 09th 
Dec 2017 which I acknowledged on 11th Dec 2017 and which should be in 
Richard's queue to be applied.

It should at some point show up in Linux-next.

Best Regards and once again, thanks for looking into it.

A.


On 01/05/18 07:22, Wei Yongjun wrote:
> 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);
>
>

-- 
Anton R. Ivanov

Cambridge Greys Limited, England and Wales company No 10273661
http://www.cambridgegreys.com/

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-01-05 10:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-05  7:22 [PATCH -next] um: vector: fix missing unlock on error in vector_net_open() Wei Yongjun
2018-01-05 10:12 ` Anton Ivanov

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®