diff options
author | Niklas Schnelle <schnelle@linux.ibm.com> | 2021-08-06 10:28:40 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-10-27 09:59:54 +0200 |
commit | e27170d5f2fca8a42d610e0c87e52c41cfae7a21 (patch) | |
tree | b276c0848af4a3148fd30b5308ec4535afae8d20 /arch | |
parent | 2be38f02ec891ce3cdcd93649960a207866a9b8a (diff) |
s390/pci: cleanup resources only if necessary
commit 02368b7cf6c7badefa13741aed7a8b91d9a11b19 upstream.
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: Matthew Rosato <mjrosato@linux.ibm.com>
Acked-by: Pierre Morel <pmorel@linux.ibm.com>
Signed-off-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/s390/pci/pci.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/s390/pci/pci.c b/arch/s390/pci/pci.c index 34839bad33e4..5e234cb2ad7b 100644 --- a/arch/s390/pci/pci.c +++ b/arch/s390/pci/pci.c @@ -829,7 +829,8 @@ void zpci_release_device(struct kref *kref) case ZPCI_FN_STATE_STANDBY: if (zdev->has_hp_slot) zpci_exit_slot(zdev); - zpci_cleanup_bus_resources(zdev); + if (zdev->has_resources) + zpci_cleanup_bus_resources(zdev); zpci_bus_device_unregister(zdev); zpci_destroy_iommu(zdev); fallthrough; |