Re: (subset) [PATCH] soc: qcom: rpmpd: Check for null return of devm_kcalloc

From: Bjorn Andersson
Date: Fri Feb 04 2022 - 13:35:48 EST


On Fri, 31 Dec 2021 17:44:19 +0800, Jiasheng Jiang wrote:
> Because of the possible failure of the allocation, data->domains might
> be NULL pointer and will cause the dereference of the NULL pointer
> later.
> Therefore, it might be better to check it and directly return -ENOMEM
> without releasing data manually if fails, because the comment of the
> devm_kmalloc() says "Memory allocated with this function is
> automatically freed on driver detach.".
>
> [...]

Applied, thanks!

[1/1] soc: qcom: rpmpd: Check for null return of devm_kcalloc
commit: 5a811126d38f9767a20cc271b34db7c8efc5a46c

Best regards,
--
Bjorn Andersson <bjorn.andersson@xxxxxxxxxx>