diff options
-rw-r--r-- | drivers/pci/hotplug/ibmphp_core.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/pci/hotplug/ibmphp_core.c b/drivers/pci/hotplug/ibmphp_core.c index 87b6b8b280e6..81d009229188 100644 --- a/drivers/pci/hotplug/ibmphp_core.c +++ b/drivers/pci/hotplug/ibmphp_core.c | |||
@@ -148,8 +148,10 @@ int ibmphp_init_devno(struct slot **cur_slot) | |||
148 | len = (rtable->size - sizeof(struct irq_routing_table)) / | 148 | len = (rtable->size - sizeof(struct irq_routing_table)) / |
149 | sizeof(struct irq_info); | 149 | sizeof(struct irq_info); |
150 | 150 | ||
151 | if (!len) | 151 | if (!len) { |
152 | kfree(rtable); | ||
152 | return -1; | 153 | return -1; |
154 | } | ||
153 | for (loop = 0; loop < len; loop++) { | 155 | for (loop = 0; loop < len; loop++) { |
154 | if ((*cur_slot)->number == rtable->slots[loop].slot) { | 156 | if ((*cur_slot)->number == rtable->slots[loop].slot) { |
155 | if ((*cur_slot)->bus == rtable->slots[loop].bus) { | 157 | if ((*cur_slot)->bus == rtable->slots[loop].bus) { |
@@ -187,11 +189,13 @@ int ibmphp_init_devno(struct slot **cur_slot) | |||
187 | debug("rtable->slots[loop].irq[3].link = %x\n", | 189 | debug("rtable->slots[loop].irq[3].link = %x\n", |
188 | rtable->slots[loop].irq[3].link); | 190 | rtable->slots[loop].irq[3].link); |
189 | debug("end of init_devno\n"); | 191 | debug("end of init_devno\n"); |
192 | kfree(rtable); | ||
190 | return 0; | 193 | return 0; |
191 | } | 194 | } |
192 | } | 195 | } |
193 | } | 196 | } |
194 | 197 | ||
198 | kfree(rtable); | ||
195 | return -1; | 199 | return -1; |
196 | } | 200 | } |
197 | 201 | ||