aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/intersil/p54/eeprom.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/intersil/p54/eeprom.c')
-rw-r--r--drivers/net/wireless/intersil/p54/eeprom.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/net/wireless/intersil/p54/eeprom.c b/drivers/net/wireless/intersil/p54/eeprom.c
index d4c73d39336f..de2ef95c386c 100644
--- a/drivers/net/wireless/intersil/p54/eeprom.c
+++ b/drivers/net/wireless/intersil/p54/eeprom.c
@@ -161,8 +161,9 @@ static int p54_generate_band(struct ieee80211_hw *dev,
161 if (!tmp) 161 if (!tmp)
162 goto err_out; 162 goto err_out;
163 163
164 tmp->channels = kzalloc(sizeof(struct ieee80211_channel) * 164 tmp->channels = kcalloc(list->band_channel_num[band],
165 list->band_channel_num[band], GFP_KERNEL); 165 sizeof(struct ieee80211_channel),
166 GFP_KERNEL);
166 if (!tmp->channels) 167 if (!tmp->channels)
167 goto err_out; 168 goto err_out;
168 169
@@ -344,7 +345,7 @@ static int p54_generate_channel_lists(struct ieee80211_hw *dev)
344 goto free; 345 goto free;
345 } 346 }
346 priv->chan_num = max_channel_num; 347 priv->chan_num = max_channel_num;
347 priv->survey = kzalloc(sizeof(struct survey_info) * max_channel_num, 348 priv->survey = kcalloc(max_channel_num, sizeof(struct survey_info),
348 GFP_KERNEL); 349 GFP_KERNEL);
349 if (!priv->survey) { 350 if (!priv->survey) {
350 ret = -ENOMEM; 351 ret = -ENOMEM;
@@ -352,8 +353,9 @@ static int p54_generate_channel_lists(struct ieee80211_hw *dev)
352 } 353 }
353 354
354 list->max_entries = max_channel_num; 355 list->max_entries = max_channel_num;
355 list->channels = kzalloc(sizeof(struct p54_channel_entry) * 356 list->channels = kcalloc(max_channel_num,
356 max_channel_num, GFP_KERNEL); 357 sizeof(struct p54_channel_entry),
358 GFP_KERNEL);
357 if (!list->channels) { 359 if (!list->channels) {
358 ret = -ENOMEM; 360 ret = -ENOMEM;
359 goto free; 361 goto free;