lkml.org 
[lkml]   [2019]   [Jun]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] pci: ibmphp: add check of return value from pci_hp_register()
Date
Check the return value of pci_hp_register() in Function
ebda_rsrc_controller()

Signed-off-by: Emanuel Bennici <benniciemanuel78@gmail.com>
---
drivers/pci/hotplug/ibmphp_ebda.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/hotplug/ibmphp_ebda.c b/drivers/pci/hotplug/ibmphp_ebda.c
index 11a2661dc062..7e523ce071b3 100644
--- a/drivers/pci/hotplug/ibmphp_ebda.c
+++ b/drivers/pci/hotplug/ibmphp_ebda.c
@@ -896,10 +896,17 @@ static int __init ebda_rsrc_controller(void)

} /* each hpc */

+ int result = 0;
list_for_each_entry(tmp_slot, &ibmphp_slot_head, ibm_slot_list) {
snprintf(name, SLOT_NAME_SIZE, "%s", create_file_name(tmp_slot));
- pci_hp_register(&tmp_slot->hotplug_slot,
- pci_find_bus(0, tmp_slot->bus), tmp_slot->device, name);
+ result = pci_hp_register(&tmp_slot->hotplug_slot,
+ pci_find_bus(0, tmp_slot->bus),
+ tmp_slot->device, name);
+
+ if (result) {
+ err("pci_hp_register failed with error %d\n", result);
+ goto error;
+ }
}

print_ebda_hpc();
--
2.19.1
\
 
 \ /
  Last update: 2019-06-02 16:31    [W:0.030 / U:4.088 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site