* re: 6lowpan: introduce 6lowpan-nd
@ 2016-06-21 7:31 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2016-06-21 7:31 UTC (permalink / raw)
To: aar; +Cc: linux-wpan
Hello Alexander Aring,
The patch bbe5f5cefe28: "6lowpan: introduce 6lowpan-nd" from Jun 15,
2016, leads to the following static checker warning:
net/6lowpan/ndisc.c:139 lowpan_ndisc_opt_addr_space()
error: double unlock 'read_lock:&neigh->lock'
net/6lowpan/ndisc.c
116 static int lowpan_ndisc_opt_addr_space(const struct net_device *dev,
117 u8 icmp6_type, struct neighbour *neigh,
118 u8 *ha_buf, u8 **ha)
119 {
120 struct lowpan_802154_neigh *n;
121 struct wpan_dev *wpan_dev;
122 int addr_space = 0;
123
124 if (!lowpan_is_ll(dev, LOWPAN_LLTYPE_IEEE802154))
125 return 0;
126
127 switch (icmp6_type) {
128 case NDISC_REDIRECT:
129 n = lowpan_802154_neigh(neighbour_priv(neigh));
130
131 read_lock_bh(&neigh->lock);
132 if (lowpan_802154_is_valid_src_short_addr(n->short_addr)) {
133 memcpy(ha_buf, &n->short_addr,
134 IEEE802154_SHORT_ADDR_LEN);
135 read_unlock_bh(&neigh->lock);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Unlock.
136 addr_space += __ndisc_opt_addr_space(IEEE802154_SHORT_ADDR_LEN, 0);
137 *ha = ha_buf;
138 }
139 read_unlock_bh(&neigh->lock);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Second unlock.
140 break;
141 case NDISC_NEIGHBOUR_ADVERTISEMENT:
142 case NDISC_NEIGHBOUR_SOLICITATION:
143 case NDISC_ROUTER_SOLICITATION:
regards,
dan carpenter
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-06-21 7:32 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-21 7:31 6lowpan: introduce 6lowpan-nd Dan Carpenter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.