Commit 02368b7c authored by Niklas Schnelle's avatar Niklas Schnelle Committed by Heiko Carstens

s390/pci: cleanup resources only if necessary

It's currently safe to call zpci_cleanup_bus_resources() even if the
resources were never created but it makes no sense so check
zdev->has_resources before we call zpci_cleanup_bus_resources() in
zpci_release_device().
Reviewed-by: default avatarMatthew Rosato <mjrosato@linux.ibm.com>
Acked-by: default avatarPierre Morel <pmorel@linux.ibm.com>
Signed-off-by: default avatarNiklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
parent 7c0eaa78
...@@ -822,6 +822,7 @@ void zpci_release_device(struct kref *kref) ...@@ -822,6 +822,7 @@ void zpci_release_device(struct kref *kref)
case ZPCI_FN_STATE_STANDBY: case ZPCI_FN_STATE_STANDBY:
if (zdev->has_hp_slot) if (zdev->has_hp_slot)
zpci_exit_slot(zdev); zpci_exit_slot(zdev);
if (zdev->has_resources)
zpci_cleanup_bus_resources(zdev); zpci_cleanup_bus_resources(zdev);
zpci_bus_device_unregister(zdev); zpci_bus_device_unregister(zdev);
zpci_destroy_iommu(zdev); zpci_destroy_iommu(zdev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment