aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTuo Li <islituo@gmail.com>2021-08-05 09:55:35 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-09-30 10:07:54 +0200
commit8515965e5e33f4feb56134348c95953f3eadfb26 (patch)
tree9312eb2fb588f0d5ea5cb3801049bb436e758fcd
parentmedia: aspeed-video: ignore interrupts that aren't enabled (diff)
downloadlinux-dev-8515965e5e33f4feb56134348c95953f3eadfb26.tar.xz
linux-dev-8515965e5e33f4feb56134348c95953f3eadfb26.zip
media: s5p-mfc: fix possible null-pointer dereference in s5p_mfc_probe()
The variable pdev is assigned to dev->plat_dev, and dev->plat_dev is checked in: if (!dev->plat_dev) This indicates both dev->plat_dev and pdev can be NULL. If so, the function dev_err() is called to print error information. dev_err(&pdev->dev, "No platform data specified\n"); However, &pdev->dev is an illegal address, and it is dereferenced in dev_err(). To fix this possible null-pointer dereference, replace dev_err() with mfc_err(). Reported-by: TOTE Robot <oslab@tsinghua.edu.cn> Signed-off-by: Tuo Li <islituo@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-rw-r--r--drivers/media/platform/s5p-mfc/s5p_mfc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c
index e0ec24b39fd4..293af8e664f4 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
@@ -1283,7 +1283,7 @@ static int s5p_mfc_probe(struct platform_device *pdev)
spin_lock_init(&dev->condlock);
dev->plat_dev = pdev;
if (!dev->plat_dev) {
- dev_err(&pdev->dev, "No platform data specified\n");
+ mfc_err("No platform data specified\n");
return -ENODEV;
}