From: YueHaibing Date: Thu, 19 Jul 2018 02:27:13 +0000 (+0800) Subject: net: caif: Add a missing rcu_read_unlock() in caif_flow_cb X-Git-Tag: v4.18-rc7~23^2~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=64119e05f7b31e83e2555f6782e6cdc8f81c63f4;p=thirdparty%2Fkernel%2Flinux.git net: caif: Add a missing rcu_read_unlock() in caif_flow_cb Add a missing rcu_read_unlock in the error path Fixes: c95567c80352 ("caif: added check for potential null return") Signed-off-by: YueHaibing Signed-off-by: David S. Miller --- diff --git a/net/caif/caif_dev.c b/net/caif/caif_dev.c index e0adcd123f48a..711d7156efd8b 100644 --- a/net/caif/caif_dev.c +++ b/net/caif/caif_dev.c @@ -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();