clocksource/drivers/timer-imx-gpt: Fix potential memory leak
authorJacky Bai <ping.bai@nxp.com>
Mon, 9 Oct 2023 08:39:22 +0000 (16:39 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2023 17:06:54 +0000 (17:06 +0000)
commitff8370a0d8cbb983a392080dcd3c3f9d37f23bdb
treee11972eca75faf9a3418d9925a21a727ad2f60e6
parent9f4c391dc2bc3fcb8d2b226aa4e761124c6e525f
clocksource/drivers/timer-imx-gpt: Fix potential memory leak

[ Upstream commit 8051a993ce222a5158bccc6ac22ace9253dd71cb ]

Fix coverity Issue CID 250382:  Resource leak (RESOURCE_LEAK).
Add kfree when error return.

Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20231009083922.1942971-1-ping.bai@nxp.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/clocksource/timer-imx-gpt.c