[PATCH v1 09/10] j1939: transport: warn if skb can't be freed in j1939_session_destroy()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



To detect skb refcounting issues ASAP. skb_share() will return true, if
number of users (i.e. refcounting) is not equal 1.

Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
---
 net/can/j1939/transport.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/can/j1939/transport.c b/net/can/j1939/transport.c
index 6e097f75d3b7..afc17ee93316 100644
--- a/net/can/j1939/transport.c
+++ b/net/can/j1939/transport.c
@@ -125,6 +125,7 @@ static void j1939_session_destroy(struct j1939_session *session)
 	j1939_session_list_lock(session->priv);
 	j1939_session_list_del(session);
 	j1939_session_list_unlock(session->priv);
+	WARN_ON_ONCE(skb_shared(session->skb));
 	kfree_skb(session->skb);
 	j1939_priv_put(session->priv);
 	kfree(session);
-- 
2.19.1




[Index of Archives]     [Automotive Discussions]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [CAN Bus]

  Powered by Linux