diff options
| author | Jeremy Kerr <[email protected]> | 2024-12-18 03:53:01 +0000 |
|---|---|---|
| committer | Paolo Abeni <[email protected]> | 2024-12-19 10:52:49 +0000 |
| commit | ce1219c3f76bb131d095e90521506d3c6ccfa086 (patch) | |
| tree | 02725b6434d9f1b7dd5bda30a10e448b075d5993 /tools/testing/selftests/net/lib/py/ynl.py | |
| parent | net: mdiobus: fix an OF node reference leak (diff) | |
| download | kernel-ce1219c3f76bb131d095e90521506d3c6ccfa086.tar.gz kernel-ce1219c3f76bb131d095e90521506d3c6ccfa086.zip | |
net: mctp: handle skb cleanup on sock_queue failures
Currently, we don't use the return value from sock_queue_rcv_skb, which
means we may leak skbs if a message is not successfully queued to a
socket.
Instead, ensure that we're freeing the skb where the sock hasn't
otherwise taken ownership of the skb by adding checks on the
sock_queue_rcv_skb() to invoke a kfree on failure.
In doing so, rather than using the 'rc' value to trigger the
kfree_skb(), use the skb pointer itself, which is more explicit.
Also, add a kunit test for the sock delivery failure cases.
Fixes: 4a992bbd3650 ("mctp: Implement message fragmentation & reassembly")
Cc: [email protected]
Signed-off-by: Jeremy Kerr <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Paolo Abeni <[email protected]>
Diffstat (limited to 'tools/testing/selftests/net/lib/py/ynl.py')
0 files changed, 0 insertions, 0 deletions
