]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: intel/ipu6: fix error pointer dereference
authorEthan Tidmore <ethantidmore06@gmail.com>
Sat, 7 Mar 2026 03:03:55 +0000 (21:03 -0600)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Wed, 11 Mar 2026 00:05:35 +0000 (01:05 +0100)
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 before going 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>
[Sakari Ailus: Fix commit message.]
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/pci/intel/ipu6/ipu6.c

index 34f67f4f1bb5671f8f18b92b681a50f00576ee92..d033d4618169272eae9b2d4f9f1307ee45f34ebd 100644 (file)
@@ -686,7 +686,7 @@ out_free_irq:
 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);
        }