]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
net: caif: Add a missing rcu_read_unlock() in caif_flow_cb
authorYueHaibing <yuehaibing@huawei.com>
Thu, 19 Jul 2018 02:27:13 +0000 (10:27 +0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 21 Jul 2018 23:14:39 +0000 (16:14 -0700)
Add a missing rcu_read_unlock in the error path

Fixes: c95567c80352 ("caif: added check for potential null return")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/caif/caif_dev.c

index e0adcd123f48a1a4f66028bbf731132ed8e7ff17..711d7156efd8bc94b449d0e8066eedd4fe0d5747 100644 (file)
@@ -131,8 +131,10 @@ static void caif_flow_cb(struct sk_buff *skb)
        caifd = caif_get(skb->dev);
 
        WARN_ON(caifd == NULL);
-       if (caifd == NULL)
+       if (!caifd) {
+               rcu_read_unlock();
                return;
+       }
 
        caifd_hold(caifd);
        rcu_read_unlock();