[PATCH v2] ARM: imx: Check return value of devm_kasprintf in imx_mmdc_perf_init

Shawn Guo shawnguo at kernel.org
Tue Dec 5 17:44:29 PST 2023


On Wed, Nov 22, 2023 at 02:46:36PM +0800, Kunwu Chan wrote:
> 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 at pengutronix.de>
> Fixes: e76bdfd7403a ("ARM: imx: Added perf functionality to mmdc driver")
> Signed-off-by: Kunwu Chan <chentao at kylinos.cn>

Applied, thanks!



More information about the linux-arm-kernel mailing list