netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: caif: Add a missing rcu_read_unlock() in caif_flow_cb
@ 2018-07-19  2:27 YueHaibing
  2018-07-21 23:16 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: YueHaibing @ 2018-07-19  2:27 UTC (permalink / raw)
  To: davem, dmitry.tarnyagin; +Cc: linux-kernel, netdev, YueHaibing

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>
---
 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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] net: caif: Add a missing rcu_read_unlock() in caif_flow_cb
  2018-07-19  2:27 [PATCH net-next] net: caif: Add a missing rcu_read_unlock() in caif_flow_cb YueHaibing
@ 2018-07-21 23:16 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2018-07-21 23:16 UTC (permalink / raw)
  To: yuehaibing; +Cc: dmitry.tarnyagin, linux-kernel, netdev

From: YueHaibing <yuehaibing@huawei.com>
Date: Thu, 19 Jul 2018 10:27:13 +0800

> 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>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-07-21 23:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-19  2:27 [PATCH net-next] net: caif: Add a missing rcu_read_unlock() in caif_flow_cb YueHaibing
2018-07-21 23:16 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).