Showing error 1916

User: Jiri Slaby
Error type: Invalid Pointer Dereference
Error type description: A pointer which is invalid is being dereferenced
File location: drivers/net/wireless/ath9k/rc.c
Line in file: 899
Project: Linux Kernel
Project version: 2.6.28
Tools: Cppcheck (1.59)
Entered: 2013-10-17 18:38:34 UTC


Source:

 869static u8 ath_rc_ratefind_ht(struct ath_softc *sc,
 870                             struct ath_rate_node *ath_rc_priv,
 871                             const struct ath_rate_table *rate_table,
 872                             int probe_allowed, int *is_probing,
 873                             int is_retry)
 874{
 875        u32 dt, best_thruput, this_thruput, now_msec;
 876        u8 rate, next_rate, best_rate, maxindex, minindex;
 877        int8_t  rssi_last, rssi_reduce = 0, index = 0;
 878        struct ath_tx_ratectrl  *rate_ctrl = NULL;
 879
 880        rate_ctrl = (struct ath_tx_ratectrl *)(ath_rc_priv ?
 881                                               (ath_rc_priv) : NULL);
 882
 883        *is_probing = FALSE;
 884
 885        rssi_last = median(rate_ctrl->rssi_last,
 886                           rate_ctrl->rssi_last_prev,
 887                           rate_ctrl->rssi_last_prev2);
 888
 889        /*
 890         * Age (reduce) last ack rssi based on how old it is.
 891         * The bizarre numbers are so the delta is 160msec,
 892         * meaning we divide by 16.
 893         *   0msec   <= dt <= 25msec:   don't derate
 894         *   25msec  <= dt <= 185msec:  derate linearly from 0 to 10dB
 895         *   185msec <= dt:             derate by 10dB
 896         */
 897
 898        now_msec = jiffies_to_msecs(jiffies);
 899        dt = now_msec - rate_ctrl->rssi_time;
 900
 901        if (dt >= 185)
 902                rssi_reduce = 10;
 903        else if (dt >= 25)
 904                rssi_reduce = (u8)((dt - 25) >> 4);
 905
 906        /* Now reduce rssi_last by rssi_reduce */
 907        if (rssi_last < rssi_reduce)
 908                rssi_last = 0;
 909        else
Show full sources