Thread (6 messages) 6 messages, 3 authors, 2016-06-27

[PATCH bluetooth-next 1/2] 6lowpan: ndisc: fix double read unlock

flat view
STALE3758d

From: Alexander Aring <hidden>
Date: 2016-06-21 08:27:18
Subsystem: 6lowpan generic (btle/ieee 802.15.4), networking [general], the rest · Maintainers: Alexander Aring, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

This patch removes a double unlock case to accessing neighbour private
data.

Reported-by: Dan Carpenter <redacted>
Signed-off-by: Alexander Aring <redacted>
---
 net/6lowpan/ndisc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/6lowpan/ndisc.c b/net/6lowpan/ndisc.c
index ae1d419..030504e 100644
--- a/net/6lowpan/ndisc.c
+++ b/net/6lowpan/ndisc.c
@@ -135,8 +135,9 @@ static int lowpan_ndisc_opt_addr_space(const struct net_device *dev,
 			read_unlock_bh(&neigh->lock);
 			addr_space += __ndisc_opt_addr_space(IEEE802154_SHORT_ADDR_LEN, 0);
 			*ha = ha_buf;
+		} else {
+			read_unlock_bh(&neigh->lock);
 		}
-		read_unlock_bh(&neigh->lock);
 		break;
 	case NDISC_NEIGHBOUR_ADVERTISEMENT:
 	case NDISC_NEIGHBOUR_SOLICITATION:
-- 
2.9.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help