Kunwu Chan 12ac3b0ab8 ARM: imx: Check return value of devm_kasprintf in imx_mmdc_perf_init
[ Upstream commit 1c2b1049af3f86545fcc5fae0fc725fb64b3a09e ]

devm_kasprintf() returns a pointer to dynamically allocated memory
which can be NULL upon failure. Ensure the allocation was successful
by checking the pointer validity.

Release the id allocated in 'mmdc_pmu_init' when 'devm_kasprintf'
return NULL

Suggested-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Fixes: e76bdfd7403a ("ARM: imx: Added perf functionality to mmdc driver")
Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-12-13 18:39:16 +01:00
..
2021-10-26 10:13:31 +01:00
2023-02-01 08:34:04 +01:00
2019-06-21 09:58:42 -07:00
2020-03-11 15:17:02 +08:00
2021-06-12 12:02:57 +08:00
2021-06-12 12:02:57 +08:00
2020-09-22 14:08:13 +08:00
2020-09-22 14:08:13 +08:00
2020-09-22 14:08:13 +08:00
2021-06-12 12:02:57 +08:00
2021-10-26 10:13:31 +01:00