um: vector: fix missing unlock on error in vector_net_open()
authorWei Yongjun <weiyongjun1@huawei.com>
Fri, 5 Jan 2018 07:22:52 +0000 (07:22 +0000)
committerRichard Weinberger <richard@nod.at>
Mon, 19 Feb 2018 18:38:51 +0000 (19:38 +0100)
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>
Signed-off-by: Richard Weinberger <richard@nod.at>
arch/um/drivers/vector_kern.c

index d1d5301..bb83a2d 100644 (file)
@@ -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);