2008/9/24 Bob Copeland <[EMAIL PROTECTED]>:
>> b) During attach i do a bad memory allocation
>> ani_stats = kzalloc(sizeof(struct ath5k_ani_state), GFP_KERNEL);
>> just change it to
>> ani_stats = kzalloc(sizeof(struct ath5k_ani_stats), GFP_KERNEL);
>
> Looks like more is wrong with that:
>
>> int ath5k_hw_ani_attach(struct ath5k_hw *ah){
>>       struct ath5k_ani_state *ani_state = ah->ah_ani_state;
>>       struct ath5k_ani_stats *ani_stats = ah->ah_ani_stats;
>>       struct ath5k_softc *sc = ah->ah_sc;
>>
>>       /* Allocate needed structs */
>>       ani_state = kzalloc(sizeof(struct ath5k_ani_state), GFP_KERNEL);
>>       [...]
>>       ath5k_hw_ani_set_min_immunity(ah);
>
> Shouldn't this be something like:
>
>        ah->ah_ai_state = kzalloc()...
>
> Otherwise ath5k_hw_ani_set_min_immunity segfaults immediately.

Already tested that and it doesn't segfault, we set ah_ani_state before
that...
struct ath5k_ani_state *ani_state = ah->ah_ani_state;

> Also
> there's a memleak there if the first kzalloc works but the second fails :)
>

Yup we 'll make a label err: or something, that's not what i'm after
right now, we must find out the initial values we should use and make
it work.

> Otherwise, thanks for posting the code!  I hope to digest it over the
> next day or two...
>

Cool ;-)


-- 
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick
_______________________________________________
ath5k-devel mailing list
ath5k-devel@lists.ath5k.org
https://lists.ath5k.org/mailman/listinfo/ath5k-devel

Reply via email to