Skip to content

Commit b570e36

Browse files
lituo1996gregkh
authored andcommitted
media: s5p-mfc: fix possible null-pointer dereference in s5p_mfc_probe()
[ Upstream commit 8515965 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent f4037b9 commit b570e36

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/media/platform/s5p-mfc/s5p_mfc.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1283,7 +1283,7 @@ static int s5p_mfc_probe(struct platform_device *pdev)
12831283
spin_lock_init(&dev->condlock);
12841284
dev->plat_dev = pdev;
12851285
if (!dev->plat_dev) {
1286-
dev_err(&pdev->dev, "No platform data specified\n");
1286+
mfc_err("No platform data specified\n");
12871287
return -ENODEV;
12881288
}
12891289

0 commit comments

Comments
 (0)