Go to file
Zhang Changzhong 3a174ffbc1 remoteproc: qcom: Fix potential NULL dereference in adsp_init_mmio()
[ Upstream commit c3d4e5b12672bbdf63f4cc933e3169bc6bbec8da ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-03-16 16:43:11 +08:00
Documentation KVM: mmu: Fix SPTE encoding of MMIO generation upper half 2021-03-16 16:42:21 +08:00
LICENSES Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
arch x86/kprobes: Restore BTF if the single-stepping is cancelled 2021-03-16 16:43:09 +08:00
block blk-mq: In blk_mq_dispatch_rq_list() "no budget" is a reason to kick 2021-03-16 16:42:26 +08:00
certs Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
crypto crypto: af_alg - avoid undefined behavior accessing salg_name 2021-03-16 16:42:34 +08:00
drivers remoteproc: qcom: Fix potential NULL dereference in adsp_init_mmio() 2021-03-16 16:43:11 +08:00
fs erofs: avoid using generic_block_bmap 2021-03-16 16:43:10 +08:00
include seq_buf: Avoid type mismatch for seq_buf_init 2021-03-16 16:43:06 +08:00
init printk: reduce LOG_BUF_SHIFT range for H8300 2021-03-16 16:39:45 +08:00
ipc ipc/util.c: sysvipc_find_ipc() incorrectly updates position index 2021-03-16 16:27:51 +08:00
kernel bpf: Fix bpf_put_raw_tracepoint()'s use of __module_address() 2021-03-16 16:43:01 +08:00
lib lib/syscall: fix syscall registers retrieval on 32-bit platforms 2021-03-16 16:42:06 +08:00
mm mm/zsmalloc.c: drop ZSMALLOC_PGTABLE_MAPPING 2021-03-16 16:42:15 +08:00
net net: sunrpc: Fix 'snprintf' return value check in 'do_xprt_debugfs' 2021-03-16 16:42:59 +08:00
package config/arm64: OPEN CONFIG_PSI and phytium configs 2021-03-16 11:02:59 +08:00
samples samples: bpf: Fix lwt_len_hist reusing previous BPF map 2021-03-16 16:42:53 +08:00
scripts kbuild: avoid split lines in .mod files 2021-03-16 16:42:30 +08:00
security selinux: fix inode_doinit_with_dentry() LABEL_INVALID error handling 2021-03-16 16:42:41 +08:00
sound ASoC: amd: change clk_get() to devm_clk_get() and add missed checks 2021-03-16 16:43:08 +08:00
tools selftests/seccomp: Update kernel config 2021-03-16 16:43:00 +08:00
usr Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
virt KVM: arm64: vgic-v3: Drop the reporting of GICR_TYPER.Last for userspace 2021-03-16 16:41:35 +08:00
.clang-format Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
.cocciconfig Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
.get_maintainer.ignore Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
.gitattributes Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
.gitignore Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
COPYING Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
CREDITS Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Kbuild Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Kconfig Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
MAINTAINERS Documentation/llvm: add documentation on building w/ Clang/LLVM 2021-03-16 16:34:24 +08:00
Makefile Kbuild: do not emit debug info for assembly with LLVM_IAS=1 2021-03-16 16:42:09 +08:00
README Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
README.md Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
backport_remove_lists.txt Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
tools_key.pub Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00

README.md

Tencent Linux Kernel 4.0