Skip to content

Commit

Permalink
6lowpan: ndisc: fix double read unlock
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alexander Aring authored and holtmann committed Jul 8, 2016
1 parent a4770e1 commit 929946a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/6lowpan/ndisc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 929946a

Please sign in to comment.