All of lore.kernel.org
 help / color / mirror / Atom feed
* re: STAGING:iio:light: fix ISL29018 init to handle brownout
@ 2011-08-26  1:15 Dan Carpenter
  2011-08-26  5:27 ` Grant Grundler
  2011-08-26 21:58 ` Grant Grundler
  0 siblings, 2 replies; 9+ messages in thread
From: Dan Carpenter @ 2011-08-26  1:15 UTC (permalink / raw)
  To: Grant Grundler; +Cc: linux-iio, devel

Hi Grant,

There is a memory corruption bug in 176f9f29cec9 "STAGING:iio:light:
fix ISL29018 init to handle brownout".

In isl29018_chip_init() we call:
        status = isl29018_write_data(client, ISL29018_REG_TEST, 0,               
                                ISL29018_TEST_MASK, ISL29018_TEST_SHIFT);        

where ISL29018_REG_TEST is 8.

In isl29018_write_data() it uses reg (ISL29018_REG_TEST) as the
offset into the ->reg_cache[] array:
	chip->reg_cache[reg] = regval;

But ->reg_cache[] only has 3 elements, so we're past the end of the
array.

I don't know the code well enough to fix this.

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-08-30 16:45 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-26  1:15 STAGING:iio:light: fix ISL29018 init to handle brownout Dan Carpenter
2011-08-26  5:27 ` Grant Grundler
2011-08-26 21:58 ` Grant Grundler
2011-08-26 22:18   ` Dan Carpenter
2011-08-26 22:42     ` Grant Grundler
2011-08-30 10:05   ` Jonathan Cameron
2011-08-30 16:14     ` Grant Grundler
2011-08-30 16:31       ` Jonathan Cameron
2011-08-30 16:45         ` Grant Grundler

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.