diff options
author | David S. Miller <davem@davemloft.net> | 2022-08-10 09:19:50 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2022-08-10 09:19:50 +0100 |
commit | e7f164955f07c394ad0a8a57c24a0c8088630051 (patch) | |
tree | 584bb3614acf2bd65f4056e5717ba30cc01d8162 /net | |
parent | 996237d9ba4d092469fbfca18995656c32834ac7 (diff) | |
parent | d80d60b0db6ff3dd2e29247cc2a5166d7e9ae37e (diff) | |
download | linux-stable-e7f164955f07c394ad0a8a57c24a0c8088630051.tar.gz linux-stable-e7f164955f07c394ad0a8a57c24a0c8088630051.tar.bz2 linux-stable-e7f164955f07c394ad0a8a57c24a0c8088630051.zip |
Merge tag 'linux-can-fixes-for-6.0-20220810' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can
Marc Kleine-Budde says:
====================
this is a pull request of 4 patches for net/master, with the
whitespace issue fixed.
Fedor Pchelkin contributes 2 fixes for the j1939 CAN protocol.
A patch by me for the ems_usb driver fixes an unaligned access
warning.
Sebastian Würl's patch for the mcp251x driver fixes a race condition
in the receive interrupt.
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/can/j1939/socket.c | 5 | ||||
-rw-r--r-- | net/can/j1939/transport.c | 8 |
2 files changed, 11 insertions, 2 deletions
diff --git a/net/can/j1939/socket.c b/net/can/j1939/socket.c index f5ecfdcf57b2..b670ba03a675 100644 --- a/net/can/j1939/socket.c +++ b/net/can/j1939/socket.c @@ -178,7 +178,10 @@ activate_next: if (!first) return; - if (WARN_ON_ONCE(j1939_session_activate(first))) { + if (j1939_session_activate(first)) { + netdev_warn_once(first->priv->ndev, + "%s: 0x%p: Identical session is already activated.\n", + __func__, first); first->err = -EBUSY; goto activate_next; } else { diff --git a/net/can/j1939/transport.c b/net/can/j1939/transport.c index 307ee1174a6e..d7d86c944d76 100644 --- a/net/can/j1939/transport.c +++ b/net/can/j1939/transport.c @@ -260,6 +260,8 @@ static void __j1939_session_drop(struct j1939_session *session) static void j1939_session_destroy(struct j1939_session *session) { + struct sk_buff *skb; + if (session->transmission) { if (session->err) j1939_sk_errqueue(session, J1939_ERRQUEUE_TX_ABORT); @@ -274,7 +276,11 @@ static void j1939_session_destroy(struct j1939_session *session) WARN_ON_ONCE(!list_empty(&session->sk_session_queue_entry)); WARN_ON_ONCE(!list_empty(&session->active_session_list_entry)); - skb_queue_purge(&session->skb_queue); + while ((skb = skb_dequeue(&session->skb_queue)) != NULL) { + /* drop ref taken in j1939_session_skb_queue() */ + skb_unref(skb); + kfree_skb(skb); + } __j1939_session_drop(session); j1939_priv_put(session->priv); kfree(session); |