Skip to content

Commit c66ec6c

Browse files
author
Mete Durlu
committed
s390/pci: Fix missing check for zpci_create_device() error return
JIRA: https://issues.redhat.com/browse/RHEL-94944 commit 42420c5 Author: Niklas Schnelle <schnelle@linux.ibm.com> Date: Wed Apr 30 15:26:18 2025 +0200 s390/pci: Fix missing check for zpci_create_device() error return The zpci_create_device() function returns an error pointer that needs to be checked before dereferencing it as a struct zpci_dev pointer. Add the missing check in __clp_add() where it was missed when adding the scan_list in the fixed commit. Simply not adding the device to the scan list results in the previous behavior. Cc: stable@vger.kernel.org Fixes: 0467cdd ("s390/pci: Sort PCI functions prior to creating virtual busses") Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com> Reviewed-by: Gerd Bayer <gbayer@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Mete Durlu <mdurlu@redhat.com>
1 parent 4224ad0 commit c66ec6c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/s390/pci/pci_clp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,8 @@ static void __clp_add(struct clp_fh_list_entry *entry, void *data)
427427
return;
428428
}
429429
zdev = zpci_create_device(entry->fid, entry->fh, entry->config_state);
430+
if (IS_ERR(zdev))
431+
return;
430432
list_add_tail(&zdev->entry, scan_list);
431433
}
432434

0 commit comments

Comments
 (0)