Loading
staging: vchiq_arm: Use devm_kzalloc() for vchiq_arm_state allocation
stable inclusion from stable-v6.6.63 commit 0c623f5692a0f9e77c2e2aea487b353fd235306d category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/IBI1RP Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=0c623f5692a0f9e77c2e2aea487b353fd235306d -------------------------------- [ Upstream commit 404b739e895522838f1abdc340c554654d671dde ] The struct vchiq_arm_state 'platform_state' is currently allocated dynamically using kzalloc(). Unfortunately, it is never freed and is subjected to memory leaks in the error handling paths of the probe() function. To address the issue, use device resource management helper devm_kzalloc(), to ensure cleanup after its allocation. Fixes: 71bad7f0 ("staging: add bcm2708 vchiq driver") Cc: stable@vger.kernel.org Signed-off-by:Umang Jain <umang.jain@ideasonboard.com> Reviewed-by:
Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/20241016130225.61024-2-umang.jain@ideasonboard.com Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
Wen Zhiwei <wenzhiwei@kylinos.cn>