rt2x00: Invalid memory allocation check
Subsystems (3)
PATCH 8/32 rt2x00: Invalid memory allocation check
From: Ivo van Doorn <[email protected]>
Fix invalid check when allocating the memory for the rate structures. Instead of the channel pointer the rates pointer should be verified.
Signed-off-by Ivo van Doorn <[email protected]>
drivers/net/wireless/d80211/rt2x00/rt2400pci.c +1 -1
@@ -2036,7 +2036,7 @@ rt2400pci_init_hw(struct rt2x00_pci *rt2 hw->modes->num_rates =4 ; hw->modes->rates =kzalloc (sizeof (struct ieee80211_rate ) *4 ,GFP_KERNEL ); -if (!hw->modes->channels) +if (!hw->modes->rates) goto exit_free_channels;/*
drivers/net/wireless/d80211/rt2x00/rt2500pci.c +2 -2
@@ -2236,7 +2236,7 @@ rt2500pci_init_hw(struct rt2x00_pci *rt2 hw->modes->rates =kzalloc ((sizeof (struct ieee80211_rate ) *12 ),GFP_KERNEL ); -if (!hw->modes->channels) +if (!hw->modes->rates) goto exit_free_channels; }else { hw->num_modes =3 ;
@@ -2255,7 +2255,7 @@ rt2500pci_init_hw(struct rt2x00_pci *rt2 hw->modes->rates =kzalloc ((sizeof (struct ieee80211_rate ) *12 ),GFP_KERNEL ); -if (!hw->modes->channels) +if (!hw->modes->rates) goto exit_free_channels; }
drivers/net/wireless/d80211/rt2x00/rt2500usb.c +2 -2
@@ -1931,7 +1931,7 @@ rt2500usb_init_hw(struct rt2x00_usb *rt2 hw->modes->rates =kzalloc ((sizeof (struct ieee80211_rate ) *12 ),GFP_KERNEL ); -if (!hw->modes->channels) +if (!hw->modes->rates) goto exit_free_channels; }else { hw->num_modes =3 ;
@@ -1950,7 +1950,7 @@ rt2500usb_init_hw(struct rt2x00_usb *rt2 hw->modes->rates =kzalloc ((sizeof (struct ieee80211_rate ) *12 ),GFP_KERNEL ); -if (!hw->modes->channels) +if (!hw->modes->rates) goto exit_free_channels; }