Search Linux Wireless

Re: Thanks for TX power patch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Mar 12, 2009 at 10:14:09AM -0400, Bob Copeland wrote:
> 
> kfree(pd) looks wrong, because pd_curves is the kzalloc()ed part, not
> the array elements themselves.  But I tried removing that and freeing
> the pd_curves array outside of the loop and got more slab debugging
> poop.  So, I punt for now.

This seems to fix it for me...

diff --git a/drivers/net/wireless/ath5k/eeprom.c b/drivers/net/wireless/ath5k/eeprom.c
index f992b1b..0b062f6 100644
--- a/drivers/net/wireless/ath5k/eeprom.c
+++ b/drivers/net/wireless/ath5k/eeprom.c
@@ -1559,17 +1559,20 @@ ath5k_eeprom_free_pcal_info(struct ath5k_hw *ah, int mode)
 	}
 
 	for (pier = 0; pier < ee->ee_n_piers[mode]; pier++) {
+		if (!chinfo[pier].pd_curves)
+			continue;
+
 		for (pdg = 0; pdg < ee->ee_pd_gains[mode]; pdg++) {
-			struct ath5k_pdgain_info *pd = &chinfo->pd_curves[pdg];
+			struct ath5k_pdgain_info *pd =
+				&chinfo[pier].pd_curves[pdg];
 
 			if (pd != NULL) {
 				kfree(pd->pd_step);
 				kfree(pd->pd_pwr);
-				kfree(pd);
 			}
 		}
+		kfree(chinfo[pier].pd_curves);
 	}
-
 	return 0;
 }
 

-- 
Bob Copeland %% www.bobcopeland.com

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux