aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorZhu Yi <yi.zhu@intel.com>2010-03-09 03:05:31 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-03-10 16:29:02 -0500
commit41093167ec6c1854903a4bc38a37b5740c028984 (patch)
treefdd7aa2b3e9f21c7b2b63a575b988d22115fe5e6 /drivers
parent5f13bfac0718ce6f83ecba3755f224c3790e8d66 (diff)
ipw2200: use kmalloc for large local variables
Fixed below compiler warning: drivers/net/wireless/ipw2x00/ipw2200.c: In function ‘ipw_load_firmware’: drivers/net/wireless/ipw2x00/ipw2200.c:3260: warning: the frame size of 1168 bytes is larger than 1024 bytes Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/ipw2x00/ipw2200.c19
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}