diff options
author | Niklas Schnelle <schnelle@linux.ibm.com> | 2025-04-30 15:26:18 +0200 |
---|---|---|
committer | Heiko Carstens <hca@linux.ibm.com> | 2025-05-07 13:35:05 +0200 |
commit | 42420c50c68f3e95e90de2479464f420602229fc (patch) | |
tree | f2f251be42eb97eac81a1a0a40700648239b270f | |
parent | 3a47b1e3cea247857aa48cfe3d0a07e989e6c57d (diff) |
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: 0467cdde8c43 ("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>
-rw-r--r-- | arch/s390/pci/pci_clp.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/s390/pci/pci_clp.c b/arch/s390/pci/pci_clp.c index 9a929bbcc397..241f7251c873 100644 --- a/arch/s390/pci/pci_clp.c +++ b/arch/s390/pci/pci_clp.c @@ -428,6 +428,8 @@ static void __clp_add(struct clp_fh_list_entry *entry, void *data) return; } zdev = zpci_create_device(entry->fid, entry->fh, entry->config_state); + if (IS_ERR(zdev)) + return; list_add_tail(&zdev->entry, scan_list); } |