Ticket #1187: gta01-charge-state.patch

File gta01-charge-state.patch, 424 bytes (added by andrew.paulsen@…, 11 years ago)

Fixes array index error in charge state display (applies after 1182)

  • linux-2.6.22/drivers/i2c/chips/pcf50606.c

    old new  
    10401040 
    10411041        for (i = 0; i < 32; i++) 
    10421042                if (pcf->flags & (1 << i) && i < ARRAY_SIZE(chgstate_names)) 
    1043                         b += sprintf(b, "%s ", chgstate_names[i]); 
     1043                        b += sprintf(b, "%s ", chgstate_names[1<<i]); 
    10441044 
    10451045        if (b > buf) 
    10461046                b += sprintf(b, "\n");