diff options
Diffstat (limited to 'drivers/pci/hotplug/ibmphp_core.c')
-rw-r--r-- | drivers/pci/hotplug/ibmphp_core.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/pci/hotplug/ibmphp_core.c b/drivers/pci/hotplug/ibmphp_core.c index dc59da675c08..e13d5b87241a 100644 --- a/drivers/pci/hotplug/ibmphp_core.c +++ b/drivers/pci/hotplug/ibmphp_core.c | |||
@@ -1141,7 +1141,7 @@ static int enable_slot(struct hotplug_slot *hs) | |||
1141 | goto error_power; | 1141 | goto error_power; |
1142 | } | 1142 | } |
1143 | 1143 | ||
1144 | slot_cur->func = kmalloc(sizeof(struct pci_func), GFP_KERNEL); | 1144 | slot_cur->func = kzalloc(sizeof(struct pci_func), GFP_KERNEL); |
1145 | if (!slot_cur->func) { | 1145 | if (!slot_cur->func) { |
1146 | /* We cannot do update_slot_info here, since no memory for | 1146 | /* We cannot do update_slot_info here, since no memory for |
1147 | * kmalloc n.e.ways, and update_slot_info allocates some */ | 1147 | * kmalloc n.e.ways, and update_slot_info allocates some */ |
@@ -1149,7 +1149,6 @@ static int enable_slot(struct hotplug_slot *hs) | |||
1149 | rc = -ENOMEM; | 1149 | rc = -ENOMEM; |
1150 | goto error_power; | 1150 | goto error_power; |
1151 | } | 1151 | } |
1152 | memset(slot_cur->func, 0, sizeof(struct pci_func)); | ||
1153 | slot_cur->func->busno = slot_cur->bus; | 1152 | slot_cur->func->busno = slot_cur->bus; |
1154 | slot_cur->func->device = slot_cur->device; | 1153 | slot_cur->func->device = slot_cur->device; |
1155 | for (i = 0; i < 4; i++) | 1154 | for (i = 0; i < 4; i++) |
@@ -1240,9 +1239,9 @@ int ibmphp_do_disable_slot(struct slot *slot_cur) | |||
1240 | } | 1239 | } |
1241 | 1240 | ||
1242 | flag = slot_cur->flag; | 1241 | flag = slot_cur->flag; |
1243 | slot_cur->flag = TRUE; | 1242 | slot_cur->flag = 1; |
1244 | 1243 | ||
1245 | if (flag == TRUE) { | 1244 | if (flag == 1) { |
1246 | rc = validate(slot_cur, DISABLE); | 1245 | rc = validate(slot_cur, DISABLE); |
1247 | /* checking if powered off already & valid slot # */ | 1246 | /* checking if powered off already & valid slot # */ |
1248 | if (rc) | 1247 | if (rc) |
@@ -1252,13 +1251,12 @@ int ibmphp_do_disable_slot(struct slot *slot_cur) | |||
1252 | 1251 | ||
1253 | if (slot_cur->func == NULL) { | 1252 | if (slot_cur->func == NULL) { |
1254 | /* We need this for fncs's that were there on bootup */ | 1253 | /* We need this for fncs's that were there on bootup */ |
1255 | slot_cur->func = kmalloc(sizeof(struct pci_func), GFP_KERNEL); | 1254 | slot_cur->func = kzalloc(sizeof(struct pci_func), GFP_KERNEL); |
1256 | if (!slot_cur->func) { | 1255 | if (!slot_cur->func) { |
1257 | err("out of system memory\n"); | 1256 | err("out of system memory\n"); |
1258 | rc = -ENOMEM; | 1257 | rc = -ENOMEM; |
1259 | goto error; | 1258 | goto error; |
1260 | } | 1259 | } |
1261 | memset(slot_cur->func, 0, sizeof(struct pci_func)); | ||
1262 | slot_cur->func->busno = slot_cur->bus; | 1260 | slot_cur->func->busno = slot_cur->bus; |
1263 | slot_cur->func->device = slot_cur->device; | 1261 | slot_cur->func->device = slot_cur->device; |
1264 | } | 1262 | } |