diff options
Diffstat (limited to 'drivers/net/can/dev.c')
-rw-r--r-- | drivers/net/can/dev.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c index bda1888cae9a..fc59bc6f040b 100644 --- a/drivers/net/can/dev.c +++ b/drivers/net/can/dev.c | |||
@@ -13,8 +13,7 @@ | |||
13 | * GNU General Public License for more details. | 13 | * GNU General Public License for more details. |
14 | * | 14 | * |
15 | * You should have received a copy of the GNU General Public License | 15 | * You should have received a copy of the GNU General Public License |
16 | * along with this program; if not, write to the Free Software | 16 | * along with this program; if not, see <http://www.gnu.org/licenses/>. |
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | 17 | */ |
19 | 18 | ||
20 | #include <linux/module.h> | 19 | #include <linux/module.h> |
@@ -324,19 +323,10 @@ void can_put_echo_skb(struct sk_buff *skb, struct net_device *dev, | |||
324 | } | 323 | } |
325 | 324 | ||
326 | if (!priv->echo_skb[idx]) { | 325 | if (!priv->echo_skb[idx]) { |
327 | struct sock *srcsk = skb->sk; | ||
328 | 326 | ||
329 | if (atomic_read(&skb->users) != 1) { | 327 | skb = can_create_echo_skb(skb); |
330 | struct sk_buff *old_skb = skb; | 328 | if (!skb) |
331 | 329 | return; | |
332 | skb = skb_clone(old_skb, GFP_ATOMIC); | ||
333 | kfree_skb(old_skb); | ||
334 | if (!skb) | ||
335 | return; | ||
336 | } else | ||
337 | skb_orphan(skb); | ||
338 | |||
339 | skb->sk = srcsk; | ||
340 | 330 | ||
341 | /* make settings for echo to reduce code in irq context */ | 331 | /* make settings for echo to reduce code in irq context */ |
342 | skb->protocol = htons(ETH_P_CAN); | 332 | skb->protocol = htons(ETH_P_CAN); |