diff options
| -rw-r--r-- | drivers/net/wireless/ipw2x00/ipw2200.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c index 63c2a7ade5fb..5c7aa1b1eb56 100644 --- a/drivers/net/wireless/ipw2x00/ipw2200.c +++ b/drivers/net/wireless/ipw2x00/ipw2200.c | |||
| @@ -3177,14 +3177,27 @@ static int ipw_load_firmware(struct ipw_priv *priv, u8 * data, size_t len) | |||
| 3177 | int total_nr = 0; | 3177 | int total_nr = 0; |
| 3178 | int i; | 3178 | int i; |
| 3179 | struct pci_pool *pool; | 3179 | struct pci_pool *pool; |
| 3180 | u32 *virts[CB_NUMBER_OF_ELEMENTS_SMALL]; | 3180 | void **virts; |
| 3181 | dma_addr_t phys[CB_NUMBER_OF_ELEMENTS_SMALL]; | 3181 | dma_addr_t *phys; |
| 3182 | 3182 | ||
| 3183 | IPW_DEBUG_TRACE("<< : \n"); | 3183 | IPW_DEBUG_TRACE("<< : \n"); |
| 3184 | 3184 | ||
| 3185 | virts = kmalloc(sizeof(void *) * CB_NUMBER_OF_ELEMENTS_SMALL, | ||
| 3186 | GFP_KERNEL); | ||
| 3187 | if (!virts) | ||
| 3188 | return -ENOMEM; | ||
| 3189 | |||
| 3190 | phys = kmalloc(sizeof(dma_addr_t) * CB_NUMBER_OF_ELEMENTS_SMALL, | ||
| 3191 | GFP_KERNEL); | ||
| 3192 | if (!phys) { | ||
| 3193 | kfree(virts); | ||
| 3194 | return -ENOMEM; | ||
| 3195 | } | ||
| 3185 | pool = pci_pool_create("ipw2200", priv->pci_dev, CB_MAX_LENGTH, 0, 0); | 3196 | pool = pci_pool_create("ipw2200", priv->pci_dev, CB_MAX_LENGTH, 0, 0); |
| 3186 | if (!pool) { | 3197 | if (!pool) { |
| 3187 | IPW_ERROR("pci_pool_create failed\n"); | 3198 | IPW_ERROR("pci_pool_create failed\n"); |
| 3199 | kfree(phys); | ||
| 3200 | kfree(virts); | ||
| 3188 | return -ENOMEM; | 3201 | return -ENOMEM; |
| 3189 | } | 3202 | } |
| 3190 | 3203 | ||
| @@ -3254,6 +3267,8 @@ static int ipw_load_firmware(struct ipw_priv *priv, u8 * data, size_t len) | |||
| 3254 | pci_pool_free(pool, virts[i], phys[i]); | 3267 | pci_pool_free(pool, virts[i], phys[i]); |
| 3255 | 3268 | ||
| 3256 | pci_pool_destroy(pool); | 3269 | pci_pool_destroy(pool); |
| 3270 | kfree(phys); | ||
| 3271 | kfree(virts); | ||
| 3257 | 3272 | ||
| 3258 | return ret; | 3273 | return ret; |
| 3259 | } | 3274 | } |
