]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
s390/ctcm: Fix double-kfree
authorAleksei Nikiforov <aleksei.nikiforov@linux.ibm.com>
Wed, 12 Nov 2025 18:27:24 +0000 (19:27 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 1 Dec 2025 10:45:55 +0000 (11:45 +0100)
commit7ff76f8dc6b550f8d16487bf3cebc278be720b5c
tree0dfff8de9a748f9d5f3edbc2be35793e8c845a6d
parentfc13b6c92761d2def8cfc51e5a7b7bd795e76cb5
s390/ctcm: Fix double-kfree

[ Upstream commit da02a1824884d6c84c5e5b5ac373b0c9e3288ec2 ]

The function 'mpc_rcvd_sweep_req(mpcginfo)' is called conditionally
from function 'ctcmpc_unpack_skb'. It frees passed mpcginfo.
After that a call to function 'kfree' in function 'ctcmpc_unpack_skb'
frees it again.

Remove 'kfree' call in function 'mpc_rcvd_sweep_req(mpcginfo)'.

Bug detected by the clang static analyzer.

Fixes: 0c0b20587b9f25a2 ("s390/ctcm: fix potential memory leak")
Reviewed-by: Aswin Karuvally <aswin@linux.ibm.com>
Signed-off-by: Aleksei Nikiforov <aleksei.nikiforov@linux.ibm.com>
Signed-off-by: Aswin Karuvally <aswin@linux.ibm.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20251112182724.1109474-1-aswin@linux.ibm.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/s390/net/ctcm_mpc.c