diff options
Diffstat (limited to 'drivers/net/wireless/ipw2x00/ipw2200.c')
-rw-r--r-- | drivers/net/wireless/ipw2x00/ipw2200.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c index cb2552a6777c..8d6ed5f6f46f 100644 --- a/drivers/net/wireless/ipw2x00/ipw2200.c +++ b/drivers/net/wireless/ipw2x00/ipw2200.c | |||
@@ -11467,9 +11467,13 @@ static int ipw_net_init(struct net_device *dev) | |||
11467 | 11467 | ||
11468 | bg_band->band = IEEE80211_BAND_2GHZ; | 11468 | bg_band->band = IEEE80211_BAND_2GHZ; |
11469 | bg_band->n_channels = geo->bg_channels; | 11469 | bg_band->n_channels = geo->bg_channels; |
11470 | bg_band->channels = | 11470 | bg_band->channels = kcalloc(geo->bg_channels, |
11471 | kzalloc(geo->bg_channels * | 11471 | sizeof(struct ieee80211_channel), |
11472 | sizeof(struct ieee80211_channel), GFP_KERNEL); | 11472 | GFP_KERNEL); |
11473 | if (!bg_band->channels) { | ||
11474 | rc = -ENOMEM; | ||
11475 | goto out; | ||
11476 | } | ||
11473 | /* translate geo->bg to bg_band.channels */ | 11477 | /* translate geo->bg to bg_band.channels */ |
11474 | for (i = 0; i < geo->bg_channels; i++) { | 11478 | for (i = 0; i < geo->bg_channels; i++) { |
11475 | bg_band->channels[i].band = IEEE80211_BAND_2GHZ; | 11479 | bg_band->channels[i].band = IEEE80211_BAND_2GHZ; |
@@ -11502,9 +11506,13 @@ static int ipw_net_init(struct net_device *dev) | |||
11502 | 11506 | ||
11503 | a_band->band = IEEE80211_BAND_5GHZ; | 11507 | a_band->band = IEEE80211_BAND_5GHZ; |
11504 | a_band->n_channels = geo->a_channels; | 11508 | a_band->n_channels = geo->a_channels; |
11505 | a_band->channels = | 11509 | a_band->channels = kcalloc(geo->a_channels, |
11506 | kzalloc(geo->a_channels * | 11510 | sizeof(struct ieee80211_channel), |
11507 | sizeof(struct ieee80211_channel), GFP_KERNEL); | 11511 | GFP_KERNEL); |
11512 | if (!a_band->channels) { | ||
11513 | rc = -ENOMEM; | ||
11514 | goto out; | ||
11515 | } | ||
11508 | /* translate geo->bg to a_band.channels */ | 11516 | /* translate geo->bg to a_band.channels */ |
11509 | for (i = 0; i < geo->a_channels; i++) { | 11517 | for (i = 0; i < geo->a_channels; i++) { |
11510 | a_band->channels[i].band = IEEE80211_BAND_2GHZ; | 11518 | a_band->channels[i].band = IEEE80211_BAND_2GHZ; |