.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * "LAPB via ethernet" driver release 001 |
---|
3 | 4 | * |
---|
4 | 5 | * This code REQUIRES 2.1.15 or higher/ NET3.038 |
---|
5 | | - * |
---|
6 | | - * This module: |
---|
7 | | - * This module is free software; you can redistribute it and/or |
---|
8 | | - * modify it under the terms of the GNU General Public License |
---|
9 | | - * as published by the Free Software Foundation; either version |
---|
10 | | - * 2 of the License, or (at your option) any later version. |
---|
11 | 6 | * |
---|
12 | 7 | * This is a "pseudo" network driver to allow LAPB over Ethernet. |
---|
13 | 8 | * |
---|
.. | .. |
---|
71 | 66 | { |
---|
72 | 67 | struct lapbethdev *lapbeth; |
---|
73 | 68 | |
---|
74 | | - list_for_each_entry_rcu(lapbeth, &lapbeth_devices, node) { |
---|
| 69 | + list_for_each_entry_rcu(lapbeth, &lapbeth_devices, node, lockdep_rtnl_is_held()) { |
---|
75 | 70 | if (lapbeth->ethdev == dev) |
---|
76 | 71 | return lapbeth; |
---|
77 | 72 | } |
---|
.. | .. |
---|
139 | 134 | { |
---|
140 | 135 | unsigned char *ptr; |
---|
141 | 136 | |
---|
142 | | - skb_push(skb, 1); |
---|
143 | | - |
---|
144 | | - if (skb_cow(skb, 1)) |
---|
| 137 | + if (skb_cow(skb, 1)) { |
---|
| 138 | + kfree_skb(skb); |
---|
145 | 139 | return NET_RX_DROP; |
---|
| 140 | + } |
---|
| 141 | + |
---|
| 142 | + skb_push(skb, 1); |
---|
146 | 143 | |
---|
147 | 144 | ptr = skb->data; |
---|
148 | 145 | *ptr = X25_IFACE_DATA; |
---|
.. | .. |
---|
180 | 177 | case X25_IFACE_DISCONNECT: |
---|
181 | 178 | if ((err = lapb_disconnect_request(dev)) != LAPB_OK) |
---|
182 | 179 | pr_err("lapb_disconnect_request err: %d\n", err); |
---|
183 | | - /* Fall thru */ |
---|
| 180 | + fallthrough; |
---|
184 | 181 | default: |
---|
185 | 182 | goto drop; |
---|
186 | 183 | } |
---|
.. | .. |
---|
406 | 403 | if (dev_net(dev) != &init_net) |
---|
407 | 404 | return NOTIFY_DONE; |
---|
408 | 405 | |
---|
409 | | - if (!dev_is_ethdev(dev)) |
---|
| 406 | + if (!dev_is_ethdev(dev) && !lapbeth_get_x25_dev(dev)) |
---|
410 | 407 | return NOTIFY_DONE; |
---|
411 | 408 | |
---|
412 | 409 | switch (event) { |
---|