]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drivers: soc: xilinx: add the missing kfree in xlnx_add_cb_for_suspend()
authorGaosheng Cui <cuigaosheng1@huawei.com>
Sat, 6 Jul 2024 06:51:55 +0000 (14:51 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 5 Dec 2024 12:52:56 +0000 (13:52 +0100)
commit5a3bda42394ff137eb2d3d3d20d2956a8c6e9237
tree6c8f7808d21602b54f20cdba34d11c486ac85393
parentd8635acb7e6a5ab72eaecefab61fb3d6f62391b2
drivers: soc: xilinx: add the missing kfree in xlnx_add_cb_for_suspend()

[ Upstream commit 44ed4f90a97ff6f339e50ac01db71544e0990efc ]

If we fail to allocate memory for cb_data by kmalloc, the memory
allocation for eve_data is never freed, add the missing kfree()
in the error handling path.

Fixes: 05e5ba40ea7a ("driver: soc: xilinx: Add support of multiple callbacks for same event in event management driver")
Signed-off-by: Gaosheng Cui <cuigaosheng1@huawei.com>
Link: https://lore.kernel.org/r/20240706065155.452764-1-cuigaosheng1@huawei.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/soc/xilinx/xlnx_event_manager.c