aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/usb/cdc_mbim.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/net/usb/cdc_mbim.c b/drivers/net/usb/cdc_mbim.c
index c9f3281506af..13f7705fd679 100644
--- a/drivers/net/usb/cdc_mbim.c
+++ b/drivers/net/usb/cdc_mbim.c
@@ -204,17 +204,23 @@ static void do_neigh_solicit(struct usbnet *dev, u8 *buf, u16 tci)
204 return; 204 return;
205 205
206 /* need to send the NA on the VLAN dev, if any */ 206 /* need to send the NA on the VLAN dev, if any */
207 if (tci) 207 rcu_read_lock();
208 if (tci) {
208 netdev = __vlan_find_dev_deep(dev->net, htons(ETH_P_8021Q), 209 netdev = __vlan_find_dev_deep(dev->net, htons(ETH_P_8021Q),
209 tci); 210 tci);
210 else 211 if (!netdev) {
212 rcu_read_unlock();
213 return;
214 }
215 } else {
211 netdev = dev->net; 216 netdev = dev->net;
212 if (!netdev) 217 }
213 return; 218 dev_hold(netdev);
219 rcu_read_unlock();
214 220
215 in6_dev = in6_dev_get(netdev); 221 in6_dev = in6_dev_get(netdev);
216 if (!in6_dev) 222 if (!in6_dev)
217 return; 223 goto out;
218 is_router = !!in6_dev->cnf.forwarding; 224 is_router = !!in6_dev->cnf.forwarding;
219 in6_dev_put(in6_dev); 225 in6_dev_put(in6_dev);
220 226
@@ -224,6 +230,8 @@ static void do_neigh_solicit(struct usbnet *dev, u8 *buf, u16 tci)
224 true /* solicited */, 230 true /* solicited */,
225 false /* override */, 231 false /* override */,
226 true /* inc_opt */); 232 true /* inc_opt */);
233out:
234 dev_put(netdev);
227} 235}
228 236
229static bool is_neigh_solicit(u8 *buf, size_t len) 237static bool is_neigh_solicit(u8 *buf, size_t len)