can: add destructor for self generated skbs
authorOliver Hartkopp <socketcan@hartkopp.net>
Thu, 30 Jan 2014 09:11:28 +0000 (10:11 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 31 Jan 2014 00:25:49 +0000 (16:25 -0800)
commit0ae89beb283a0db5980d1d4781c7d7be2f2810d6
tree70260be9219b03dbc8e96f852a8900db7845cbc9
parent920a0fde5a32fd40b4d3c94ad72f7fc7039db8e3
can: add destructor for self generated skbs

Self generated skbuffs in net/can/bcm.c are setting a skb->sk reference but
no explicit destructor which is enforced since Linux 3.11 with commit
376c7311bdb6 (net: add a temporary sanity check in skb_orphan()).

This patch adds some helper functions to make sure that a destructor is
properly defined when a sock reference is assigned to a CAN related skb.
To create an unshared skb owned by the original sock a common helper function
has been introduced to replace open coded functions to create CAN echo skbs.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
Tested-by: Andre Naujoks <nautsch2@gmail.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/can/dev.c
drivers/net/can/janz-ican3.c
drivers/net/can/vcan.c
include/linux/can/skb.h
net/can/af_can.c
net/can/bcm.c