Skip to content

Commit 42420c5

Browse files
niklas88hcahca
authored andcommitted
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: [email protected] Fixes: 0467cdd ("s390/pci: Sort PCI functions prior to creating virtual busses") Signed-off-by: Niklas Schnelle <[email protected]> Reviewed-by: Gerd Bayer <[email protected]> Signed-off-by: Heiko Carstens <[email protected]>
1 parent 3a47b1e commit 42420c5

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
@@ -428,6 +428,8 @@ static void __clp_add(struct clp_fh_list_entry *entry, void *data)
428428
return;
429429
}
430430
zdev = zpci_create_device(entry->fid, entry->fh, entry->config_state);
431+
if (IS_ERR(zdev))
432+
return;
431433
list_add_tail(&zdev->entry, scan_list);
432434
}
433435

0 commit comments

Comments
 (0)