From mboxrd@z Thu Jan 1 00:00:00 1970 From: YueHaibing Subject: [PATCH net-next] net: caif: Add a missing rcu_read_unlock() in caif_flow_cb Date: Thu, 19 Jul 2018 10:27:13 +0800 Message-ID: <20180719022713.17324-1-yuehaibing@huawei.com> Mime-Version: 1.0 Content-Type: text/plain Cc: , , YueHaibing To: , Return-path: Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org Add a missing rcu_read_unlock in the error path Fixes: c95567c80352 ("caif: added check for potential null return") Signed-off-by: YueHaibing --- net/caif/caif_dev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/caif/caif_dev.c b/net/caif/caif_dev.c index e0adcd1..711d715 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(); -- 2.7.0