From: Wei Yongjun Date: Fri, 5 Jan 2018 07:22:52 +0000 (+0000) Subject: um: vector: fix missing unlock on error in vector_net_open() X-Git-Tag: v4.17-rc1~49^2~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9f3199bcef11caff5e935d0565de0bdb73a3798e;p=thirdparty%2Flinux.git um: vector: fix missing unlock on error in vector_net_open() 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 Signed-off-by: Richard Weinberger --- diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c index d1d53015d5724..bb83a2d22ac22 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);