can: af_can: export can_sock_destruct()
authorOleksij Rempel <o.rempel@pengutronix.de>
Thu, 7 Nov 2019 10:55:42 +0000 (11:55 +0100)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Wed, 13 Nov 2019 09:42:33 +0000 (10:42 +0100)
In j1939 we need our own struct sock::sk_destruct callback. Export the
generic af_can can_sock_destruct() that allows us to chain-call it.

Fixes: 9d71dd0c7009 ("can: add support of SAE J1939 protocol")
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
include/linux/can/core.h
net/can/af_can.c

index 8339071ab08b65ce6ab973d403b87b3822309e98..e20a0cd09ba57920fe3a63d8771ce2b60121227f 100644 (file)
@@ -65,5 +65,6 @@ extern void can_rx_unregister(struct net *net, struct net_device *dev,
                              void *data);
 
 extern int can_send(struct sk_buff *skb, int loop);
+void can_sock_destruct(struct sock *sk);
 
 #endif /* !_CAN_CORE_H */
index 5518a7d9eed922c88d496fa2dbaba3ac4d775790..128d37a4c2e0ba5d8db69fcceec8cbd6a79380df 100644 (file)
@@ -86,11 +86,12 @@ static atomic_t skbcounter = ATOMIC_INIT(0);
 
 /* af_can socket functions */
 
-static void can_sock_destruct(struct sock *sk)
+void can_sock_destruct(struct sock *sk)
 {
        skb_queue_purge(&sk->sk_receive_queue);
        skb_queue_purge(&sk->sk_error_queue);
 }
+EXPORT_SYMBOL(can_sock_destruct);
 
 static const struct can_proto *can_get_proto(int protocol)
 {