public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] media: intel/ipu6: fix error pointer dereference
@ 2026-03-07  3:03 Ethan Tidmore
  2026-03-07  6:55 ` Ethan Tidmore
  0 siblings, 1 reply; 3+ messages in thread
From: Ethan Tidmore @ 2026-03-07  3:03 UTC (permalink / raw)
  To: Sakari Ailus, Bingbu Cao, Mauro Carvalho Chehab, linux-media
  Cc: Tianshu Qiu, Hans Verkuil, linux-kernel, Ethan Tidmore, stable

In a error path isp->psys is confirmed to be an error pointer not NULL
so this condition is true and the error pointer is dereferenced. So
isp-psys should be set to NULL beforegoing to out_ipu6_bus_del_devices.

Detected by Smatch:
drivers/media/pci/intel/ipu6/ipu6.c:690 ipu6_pci_probe() error:
'isp->psys' dereferencing possible ERR_PTR()

Fixes: 25fedc021985a ("media: intel/ipu6: add Intel IPU6 PCI device driver")
Cc: stable@vger.kernel.org
Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
---
v2:
- Add stable tag.
- Add check for null instead of setting isp->psys to NULL.
- Add Smatch warning.

 drivers/media/pci/intel/ipu6/ipu6.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/pci/intel/ipu6/ipu6.c b/drivers/media/pci/intel/ipu6/ipu6.c
index 34f67f4f1bb5..d033d4618169 100644
--- a/drivers/media/pci/intel/ipu6/ipu6.c
+++ b/drivers/media/pci/intel/ipu6/ipu6.c
@@ -686,7 +686,7 @@ static int ipu6_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 out_ipu6_rpm_put:
 	pm_runtime_put_sync(&isp->psys->auxdev.dev);
 out_ipu6_bus_del_devices:
-	if (isp->psys) {
+	if (!IS_ERR_OR_NULL(isp->psys)) {
 		ipu6_cpd_free_pkg_dir(isp->psys);
 		ipu6_buttress_unmap_fw_image(isp->psys, &isp->psys->fw_sgt);
 	}
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] media: intel/ipu6: fix error pointer dereference
  2026-03-07  3:03 [PATCH v2] media: intel/ipu6: fix error pointer dereference Ethan Tidmore
@ 2026-03-07  6:55 ` Ethan Tidmore
  2026-03-09 13:30   ` Sakari Ailus
  0 siblings, 1 reply; 3+ messages in thread
From: Ethan Tidmore @ 2026-03-07  6:55 UTC (permalink / raw)
  To: Ethan Tidmore, Sakari Ailus, Bingbu Cao, Mauro Carvalho Chehab,
	linux-media
  Cc: Tianshu Qiu, Hans Verkuil, linux-kernel, stable

On Fri Mar 6, 2026 at 9:03 PM CST, Ethan Tidmore wrote:
> In a error path isp->psys is confirmed to be an error pointer not NULL
> so this condition is true and the error pointer is dereferenced. So
> isp-psys should be set to NULL beforegoing to out_ipu6_bus_del_devices.

Just noticed typo "beforegoing", will send v3 correcting this.

Thanks,

ET

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] media: intel/ipu6: fix error pointer dereference
  2026-03-07  6:55 ` Ethan Tidmore
@ 2026-03-09 13:30   ` Sakari Ailus
  0 siblings, 0 replies; 3+ messages in thread
From: Sakari Ailus @ 2026-03-09 13:30 UTC (permalink / raw)
  To: Ethan Tidmore
  Cc: Bingbu Cao, Mauro Carvalho Chehab, linux-media, Tianshu Qiu,
	Hans Verkuil, linux-kernel, stable

Hi Ethan,

On Sat, Mar 07, 2026 at 12:55:14AM -0600, Ethan Tidmore wrote:
> On Fri Mar 6, 2026 at 9:03 PM CST, Ethan Tidmore wrote:
> > In a error path isp->psys is confirmed to be an error pointer not NULL
> > so this condition is true and the error pointer is dereferenced. So
> > isp-psys should be set to NULL beforegoing to out_ipu6_bus_del_devices.
> 
> Just noticed typo "beforegoing", will send v3 correcting this.

No need to; I did that while applying the patch.

Thanks!

-- 
Regards,

Sakari Ailus

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-03-09 13:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-07  3:03 [PATCH v2] media: intel/ipu6: fix error pointer dereference Ethan Tidmore
2026-03-07  6:55 ` Ethan Tidmore
2026-03-09 13:30   ` Sakari Ailus

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox