diff options
author | Jiasheng Jiang <jiasheng@iscas.ac.cn> | 2021-12-31 17:44:19 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-04-15 14:18:07 +0200 |
commit | 755dbc3d73789ac9f0017c729abf5e4b153bf799 (patch) | |
tree | fbcb32e3edd3c2f5e2b514be495090ac4922e889 /arch/arm64/boot/dts | |
parent | 12081a152046bb591b3704593ad29424d26a6048 (diff) |
soc: qcom: rpmpd: Check for null return of devm_kcalloc
[ Upstream commit 5a811126d38f9767a20cc271b34db7c8efc5a46c ]
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.".
Fixes: bbe3a66c3f5a ("soc: qcom: rpmpd: Add a Power domain driver to model corners")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211231094419.1941054-1-jiasheng@iscas.ac.cn
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'arch/arm64/boot/dts')
0 files changed, 0 insertions, 0 deletions