projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c8f3b72
)
wireless: ipw2100: check result of kzalloc()
author
Christoph Fritz
<
[email protected]
>
Tue, 3 Aug 2010 10:54:20 +0000
(12:54 +0200)
committer
John W. Linville
<
[email protected]
>
Wed, 4 Aug 2010 19:28:37 +0000
(15:28 -0400)
If kzalloc() fails return with -ENOMEM from ipw2100_net_init() which is
called by register_netdev.
CC: Dan Carpenter <
[email protected]
>
Signed-off-by: Christoph Fritz <
[email protected]
>
Signed-off-by: John W. Linville <
[email protected]
>
drivers/net/wireless/ipw2x00/ipw2100.c
patch
|
blob
|
history
diff --git
a/drivers/net/wireless/ipw2x00/ipw2100.c
b/drivers/net/wireless/ipw2x00/ipw2100.c
index 5bbff4c5a4895b51acc66351bfcf18b212eeea3d..a146240f7ddbf1d8f85f364ce3783d877789668c 100644
(file)
--- a/
drivers/net/wireless/ipw2x00/ipw2100.c
+++ b/
drivers/net/wireless/ipw2x00/ipw2100.c
@@
-1924,6
+1924,10
@@
static int ipw2100_net_init(struct net_device *dev)
bg_band->channels =
kzalloc(geo->bg_channels *
sizeof(struct ieee80211_channel), GFP_KERNEL);
+ if (!bg_band->channels) {
+ ipw2100_down(priv);
+ return -ENOMEM;
+ }
/* translate geo->bg to bg_band.channels */
for (i = 0; i < geo->bg_channels; i++) {
bg_band->channels[i].band = IEEE80211_BAND_2GHZ;