public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Tuo Li <islituo@gmail.com>, TOTE Robot <oslab@tsinghua.edu.cn>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	Sasha Levin <sashal@kernel.org>,
	a.hajda@samsung.com, mchehab@kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-media@vger.kernel.org
Subject: [PATCH AUTOSEL 5.15 046/146] media: s5p-mfc: fix possible null-pointer dereference in s5p_mfc_probe()
Date: Mon,  8 Nov 2021 12:43:13 -0500	[thread overview]
Message-ID: <20211108174453.1187052-46-sashal@kernel.org> (raw)
In-Reply-To: <20211108174453.1187052-1-sashal@kernel.org>

From: Tuo Li <islituo@gmail.com>

[ Upstream commit 8515965e5e33f4feb56134348c95953f3eadfb26 ]

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>
---
 drivers/media/platform/s5p-mfc/s5p_mfc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c
index eba2b9f040df0..c763c0a03140c 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;
 	}
 
-- 
2.33.0


  parent reply	other threads:[~2021-11-09  1:02 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-08 17:42 [PATCH AUTOSEL 5.15 001/146] dma-buf: WARN on dmabuf release with pending attachments Sasha Levin
2021-11-08 17:42 ` [PATCH AUTOSEL 5.15 002/146] drm: panel-orientation-quirks: Update the Lenovo Ideapad D330 quirk (v2) Sasha Levin
2021-11-08 17:42 ` [PATCH AUTOSEL 5.15 003/146] drm: panel-orientation-quirks: Add quirk for KD Kurio Smart C15200 2-in-1 Sasha Levin
2021-11-08 17:42 ` [PATCH AUTOSEL 5.15 004/146] drm: panel-orientation-quirks: Add quirk for the Samsung Galaxy Book 10.6 Sasha Levin
2021-11-08 17:42 ` [PATCH AUTOSEL 5.15 005/146] Bluetooth: sco: Fix lock_sock() blockage by memcpy_from_msg() Sasha Levin
2021-11-08 17:42 ` [PATCH AUTOSEL 5.15 006/146] Bluetooth: fix use-after-free error in lock_sock_nested() Sasha Levin
2021-11-08 17:42 ` [PATCH AUTOSEL 5.15 007/146] Bluetooth: call sock_hold earlier in sco_conn_del Sasha Levin
2021-11-08 17:42 ` [PATCH AUTOSEL 5.15 008/146] drm/panel-orientation-quirks: add Valve Steam Deck Sasha Levin
2021-11-08 17:42 ` [PATCH AUTOSEL 5.15 009/146] rcutorture: Avoid problematic critical section nesting on PREEMPT_RT Sasha Levin
2021-11-08 17:42 ` [PATCH AUTOSEL 5.15 010/146] platform/x86: wmi: do not fail if disabling fails Sasha Levin
2021-11-08 17:42 ` [PATCH AUTOSEL 5.15 011/146] drm/amdgpu: move iommu_resume before ip init/resume Sasha Levin
2021-11-08 17:42 ` [PATCH AUTOSEL 5.15 012/146] MIPS: lantiq: dma: add small delay after reset Sasha Levin
2021-11-08 17:42 ` [PATCH AUTOSEL 5.15 013/146] MIPS: lantiq: dma: reset correct number of channel Sasha Levin
2021-11-08 17:42 ` [PATCH AUTOSEL 5.15 014/146] locking/lockdep: Avoid RCU-induced noinstr fail Sasha Levin
2021-11-08 17:42 ` [PATCH AUTOSEL 5.15 015/146] net: sched: update default qdisc visibility after Tx queue cnt changes Sasha Levin
2021-11-08 17:42 ` [PATCH AUTOSEL 5.15 016/146] ACPI: resources: Add DMI-based legacy IRQ override quirk Sasha Levin
2021-11-08 17:42 ` [PATCH AUTOSEL 5.15 017/146] rcu-tasks: Move RTGS_WAIT_CBS to beginning of rcu_tasks_kthread() loop Sasha Levin
2021-11-08 17:42 ` [PATCH AUTOSEL 5.15 018/146] smackfs: Fix use-after-free in netlbl_catmap_walk() Sasha Levin
2021-11-08 17:42 ` [PATCH AUTOSEL 5.15 019/146] ath11k: Align bss_chan_info structure with firmware Sasha Levin
2021-11-08 17:42 ` [PATCH AUTOSEL 5.15 020/146] crypto: aesni - check walk.nbytes instead of err Sasha Levin
2021-11-08 17:42 ` [PATCH AUTOSEL 5.15 021/146] NET: IPV4: fix error "do not initialise globals to 0" Sasha Levin
2021-11-08 17:42 ` [PATCH AUTOSEL 5.15 022/146] x86/mm/64: Improve stack overflow warnings Sasha Levin
2021-11-08 17:42 ` [PATCH AUTOSEL 5.15 023/146] x86: Increase exception stack sizes Sasha Levin
2021-11-08 17:42 ` [PATCH AUTOSEL 5.15 024/146] mwifiex: Run SET_BSS_MODE when changing from P2P to STATION vif-type Sasha Levin
2021-11-08 17:42 ` [PATCH AUTOSEL 5.15 025/146] mwifiex: Properly initialize private structure on interface type changes Sasha Levin
2021-11-08 17:42 ` [PATCH AUTOSEL 5.15 026/146] spi: Check we have a spi_device_id for each DT compatible Sasha Levin
2021-11-08 17:42 ` [PATCH AUTOSEL 5.15 027/146] fscrypt: allow 256-bit master keys with AES-256-XTS Sasha Levin
2021-11-08 17:42 ` [PATCH AUTOSEL 5.15 028/146] drm/amdgpu: Fix MMIO access page fault Sasha Levin
2021-11-08 17:42 ` [PATCH AUTOSEL 5.15 029/146] drm/amd/display: Fix null pointer dereference for encoders Sasha Levin
2021-11-08 17:42 ` [PATCH AUTOSEL 5.15 030/146] crypto: api - Fix built-in testing dependency failures Sasha Levin
2021-11-08 17:42 ` [PATCH AUTOSEL 5.15 031/146] selftests: net: fib_nexthops: Wait before checking reported idle time Sasha Levin
2021-11-08 17:42 ` [PATCH AUTOSEL 5.15 032/146] leds: trigger: use RCU to protect the led_cdevs list Sasha Levin
2021-11-08 17:43 ` [PATCH AUTOSEL 5.15 033/146] ath11k: Avoid reg rules update during firmware recovery Sasha Levin
2021-11-08 17:43 ` [PATCH AUTOSEL 5.15 034/146] ath11k: add handler for scan event WMI_SCAN_EVENT_DEQUEUED Sasha Levin
2021-11-08 17:43 ` [PATCH AUTOSEL 5.15 035/146] ath11k: Change DMA_FROM_DEVICE to DMA_TO_DEVICE when map reinjected packets Sasha Levin
2021-11-08 17:43 ` [PATCH AUTOSEL 5.15 036/146] ath10k: high latency fixes for beacon buffer Sasha Levin
2021-11-08 17:43 ` [PATCH AUTOSEL 5.15 037/146] octeontx2-pf: Enable promisc/allmulti match MCAM entries Sasha Levin
2021-11-08 17:43 ` [PATCH AUTOSEL 5.15 038/146] media: mt9p031: Fix corrupted frame after restarting stream Sasha Levin
2021-11-08 17:43 ` [PATCH AUTOSEL 5.15 039/146] media: netup_unidvb: handle interrupt properly according to the firmware Sasha Levin
2021-11-08 17:43 ` [PATCH AUTOSEL 5.15 040/146] media: atomisp: Fix error handling in probe Sasha Levin
2021-11-08 17:43 ` [PATCH AUTOSEL 5.15 041/146] media: stm32: Potential NULL pointer dereference in dcmi_irq_thread() Sasha Levin
2021-11-08 17:43 ` [PATCH AUTOSEL 5.15 042/146] media: uvcvideo: Set capability in s_param Sasha Levin
2021-11-08 17:43 ` [PATCH AUTOSEL 5.15 043/146] media: uvcvideo: Return -EIO for control errors Sasha Levin
2021-11-08 17:43 ` [PATCH AUTOSEL 5.15 044/146] media: uvcvideo: Set unique vdev name based in type Sasha Levin
2021-11-08 17:43 ` [PATCH AUTOSEL 5.15 045/146] media: vidtv: Fix memory leak in remove Sasha Levin
2021-11-08 17:43 ` Sasha Levin [this message]
2021-11-08 17:43 ` [PATCH AUTOSEL 5.15 047/146] media: s5p-mfc: Add checking to s5p_mfc_probe() Sasha Levin
2021-11-08 17:43 ` [PATCH AUTOSEL 5.15 048/146] media: videobuf2: rework vb2_mem_ops API Sasha Levin
2021-11-09  7:54 ` AUTOSEL series truncated was -- Re: [PATCH AUTOSEL 5.15 001/146] dma-buf: WARN on dmabuf release with pending attachments Pavel Machek
2021-11-09  8:07   ` Christian König
2021-11-09 16:05   ` Randy Dunlap
2021-11-14 14:25     ` Sasha Levin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211108174453.1187052-46-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=a.hajda@samsung.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=islituo@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab+huawei@kernel.org \
    --cc=mchehab@kernel.org \
    --cc=oslab@tsinghua.edu.cn \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox