summaryrefslogtreecommitdiffstats
path: root/net/6lowpan
diff options
context:
space:
mode:
authorAlexander Aring <aar@pengutronix.de>2016-06-21 10:27:18 +0200
committerMarcel Holtmann <marcel@holtmann.org>2016-07-08 12:20:57 +0200
commit929946a471c1d5c6c595b4094f4c56bdfceee9c7 (patch)
tree3b9f6cd3706591504034b13f537096cbcbee199b /net/6lowpan
parentBluetooth: Switch SMP to crypto_cipher_encrypt_one() (diff)
downloadlinux-929946a471c1d5c6c595b4094f4c56bdfceee9c7.tar.xz
linux-929946a471c1d5c6c595b4094f4c56bdfceee9c7.zip
6lowpan: ndisc: fix double read unlock
This patch removes a double unlock case to accessing neighbour private data. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Alexander Aring <aar@pengutronix.de> Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/6lowpan')
-rw-r--r--net/6lowpan/ndisc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/6lowpan/ndisc.c b/net/6lowpan/ndisc.c
index ae1d4199aa4c..030504e031b6 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: