Skip to content
Commit 1c2b1049 authored by Kunwu Chan's avatar Kunwu Chan Committed by Shawn Guo
Browse files

ARM: imx: Check return value of devm_kasprintf in imx_mmdc_perf_init



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: default avatarAhmad Fatoum <a.fatoum@pengutronix.de>
Fixes: e76bdfd7 ("ARM: imx: Added perf functionality to mmdc driver")
Signed-off-by: default avatarKunwu Chan <chentao@kylinos.cn>
Signed-off-by: default avatarShawn Guo <shawnguo@kernel.org>
parent 8ae06f13
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment