Skip to content

Commit fad134c

Browse files
Ethan Tidmoregregkh
authored andcommitted
media: intel/ipu6: fix error pointer dereference
commit 8dd088b upstream. 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: 25fedc0 ("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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 1a13602 commit fad134c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • drivers/media/pci/intel/ipu6

drivers/media/pci/intel/ipu6/ipu6.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ static int ipu6_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
685685
out_ipu6_rpm_put:
686686
pm_runtime_put_sync(&isp->psys->auxdev.dev);
687687
out_ipu6_bus_del_devices:
688-
if (isp->psys) {
688+
if (!IS_ERR_OR_NULL(isp->psys)) {
689689
ipu6_cpd_free_pkg_dir(isp->psys);
690690
ipu6_buttress_unmap_fw_image(isp->psys, &isp->psys->fw_sgt);
691691
}

0 commit comments

Comments
 (0)