History

can: af_can: export can_sock_destruct()

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.

Oleksij Rempel committed 7 years ago

Commit 975987e1 parent 5aa42772 files · +3 −1Browse files

Unified · Split

2 files
  1. include/linux/can/core.h +1 −0
  2. net/can/af_can.c +2 −1
include/linux/can/core.h+1−0
@@ -65,5 +65,6 @@ extern void can_rx_unregister(struct net *net, struct net_device *dev, · 64 unmodified lines
65 void *data);65 void *data);
66 66
67extern int can_send(struct sk_buff *skb, int loop);67extern int can_send(struct sk_buff *skb, int loop);
68void can_sock_destruct(struct sock *sk);
68 69
69#endif /* !_CAN_CORE_H */70#endif /* !_CAN_CORE_H */
net/can/af_can.c+2−1
@@ -86,11 +86,12 @@ static atomic_t skbcounter = ATOMIC_INIT(0); · 85 unmodified lines
86 86
87/* af_can socket functions */87/* af_can socket functions */
88 88
89static void can_sock_destruct(struct sock *sk)89void can_sock_destruct(struct sock *sk)
90{90{
91 skb_queue_purge(&sk->sk_receive_queue);91 skb_queue_purge(&sk->sk_receive_queue);
92 skb_queue_purge(&sk->sk_error_queue);92 skb_queue_purge(&sk->sk_error_queue);
93}93}
94EXPORT_SYMBOL(can_sock_destruct);
94 95
95static const struct can_proto *can_get_proto(int protocol)96static const struct can_proto *can_get_proto(int protocol)
96{97{

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t