diff options
author | Joe Perches <joe@perches.com> | 2010-08-11 03:02:48 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-08-17 20:45:14 -0400 |
commit | baeb2ffab4e67bb9174e6166e070a9a8ec94b0f6 (patch) | |
tree | 08259e966cc0cacc58ed58a4865fe861cc255241 /drivers/net/wireless/ipw2x00 | |
parent | 5a68d5ee000bb784c4856391b4861739c8bbd341 (diff) |
drivers/net: Convert unbounded kzalloc calls to kcalloc
These changes may be slightly safer in some instances.
There are other kzalloc calls with a multiply, but those
calls are typically "small fixed #" * sizeof(some pointer)"
and those are not converted.
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Acked-by: Luciano Coelho <luciano.coelho@nokia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wireless/ipw2x00')
-rw-r--r-- | drivers/net/wireless/ipw2x00/ipw2100.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/ipw2x00/ipw2200.c | 12 |
2 files changed, 9 insertions, 9 deletions
diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c index 1189dbb6e2a6..0c67b172d4c6 100644 --- a/drivers/net/wireless/ipw2x00/ipw2100.c +++ b/drivers/net/wireless/ipw2x00/ipw2100.c | |||
@@ -1921,9 +1921,9 @@ static int ipw2100_net_init(struct net_device *dev) | |||
1921 | 1921 | ||
1922 | bg_band->band = IEEE80211_BAND_2GHZ; | 1922 | bg_band->band = IEEE80211_BAND_2GHZ; |
1923 | bg_band->n_channels = geo->bg_channels; | 1923 | bg_band->n_channels = geo->bg_channels; |
1924 | bg_band->channels = | 1924 | bg_band->channels = kcalloc(geo->bg_channels, |
1925 | kzalloc(geo->bg_channels * | 1925 | sizeof(struct ieee80211_channel), |
1926 | sizeof(struct ieee80211_channel), GFP_KERNEL); | 1926 | GFP_KERNEL); |
1927 | if (!bg_band->channels) { | 1927 | if (!bg_band->channels) { |
1928 | ipw2100_down(priv); | 1928 | ipw2100_down(priv); |
1929 | return -ENOMEM; | 1929 | return -ENOMEM; |
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c index cb2552a6777c..0f2508384c75 100644 --- a/drivers/net/wireless/ipw2x00/ipw2200.c +++ b/drivers/net/wireless/ipw2x00/ipw2200.c | |||
@@ -11467,9 +11467,9 @@ 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 | /* translate geo->bg to bg_band.channels */ | 11473 | /* translate geo->bg to bg_band.channels */ |
11474 | for (i = 0; i < geo->bg_channels; i++) { | 11474 | for (i = 0; i < geo->bg_channels; i++) { |
11475 | bg_band->channels[i].band = IEEE80211_BAND_2GHZ; | 11475 | bg_band->channels[i].band = IEEE80211_BAND_2GHZ; |
@@ -11502,9 +11502,9 @@ static int ipw_net_init(struct net_device *dev) | |||
11502 | 11502 | ||
11503 | a_band->band = IEEE80211_BAND_5GHZ; | 11503 | a_band->band = IEEE80211_BAND_5GHZ; |
11504 | a_band->n_channels = geo->a_channels; | 11504 | a_band->n_channels = geo->a_channels; |
11505 | a_band->channels = | 11505 | a_band->channels = kcalloc(geo->a_channels, |
11506 | kzalloc(geo->a_channels * | 11506 | sizeof(struct ieee80211_channel), |
11507 | sizeof(struct ieee80211_channel), GFP_KERNEL); | 11507 | GFP_KERNEL); |
11508 | /* translate geo->bg to a_band.channels */ | 11508 | /* translate geo->bg to a_band.channels */ |
11509 | for (i = 0; i < geo->a_channels; i++) { | 11509 | for (i = 0; i < geo->a_channels; i++) { |
11510 | a_band->channels[i].band = IEEE80211_BAND_2GHZ; | 11510 | a_band->channels[i].band = IEEE80211_BAND_2GHZ; |