[PATCH net-next] net: caif: Add a missing rcu_read_unlock() in caif_flow_cb

Subsystems: networking [general], the rest

STALE2947d

2 messages, 2 authors, 2018-07-21 · open the first message on its own page

[PATCH net-next] net: caif: Add a missing rcu_read_unlock() in caif_flow_cb

From: YueHaibing <hidden>
Date: 2018-07-19 02:27:52

Add a missing rcu_read_unlock in the error path

Fixes: c95567c80352 ("caif: added check for potential null return")
Signed-off-by: YueHaibing <redacted>
---
 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

Re: [PATCH net-next] net: caif: Add a missing rcu_read_unlock() in caif_flow_cb

From: David Miller <davem@davemloft.net>
Date: 2018-07-21 23:17:22

From: YueHaibing <redacted>
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 <redacted>
Applied, thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help