diff options
author | Zhang Changzhong <zhangchangzhong@huawei.com> | 2020-12-08 02:54:20 +0100 |
---|---|---|
committer | Bjorn Andersson <bjorn.andersson@linaro.org> | 2020-12-10 20:28:08 +0100 |
commit | c3d4e5b12672bbdf63f4cc933e3169bc6bbec8da (patch) | |
tree | bfaed931b91efbedf9bb40e633f8cf7b6edb2a69 /kernel/Kconfig.preempt | |
parent | remoteproc/mediatek: Fix kernel test robot warning (diff) | |
download | linux-c3d4e5b12672bbdf63f4cc933e3169bc6bbec8da.tar.xz linux-c3d4e5b12672bbdf63f4cc933e3169bc6bbec8da.zip |
remoteproc: qcom: Fix potential NULL dereference in adsp_init_mmio()
platform_get_resource() may fail and in this case a NULL dereference
will occur.
Fix it to use devm_platform_ioremap_resource() instead of calling
platform_get_resource() and devm_ioremap().
This is detected by Coccinelle semantic patch.
@@
expression pdev, res, n, t, e, e1, e2;
@@
res = \(platform_get_resource\|platform_get_resource_byname\)(pdev, t,
n);
+ if (!res)
+ return -EINVAL;
... when != res == NULL
e = devm_ioremap(e1, res->start, e2);
Fixes: dc160e449122 ("remoteproc: qcom: Introduce Non-PAS ADSP PIL driver")
Signed-off-by: Zhang Changzhong <zhangchangzhong@huawei.com>
Link: https://lore.kernel.org/r/1607392460-20516-1-git-send-email-zhangchangzhong@huawei.com
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Diffstat (limited to 'kernel/Kconfig.preempt')
0 files changed, 0 insertions, 0 deletions