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

_______________________________________________
ath5k-devel mailing list
[email protected]
https://lists.ath5k.org/mailman/listinfo/ath5k-devel

Reply via email to