problem configuring backlight brightness levels in device tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I was trying to configure a pwm backlight on an embedded arm board
and I think I've found a minor problem.

In the source file 'drivers/video/backlight-pwm.c', in the function pwm_backlight_parse_dt()
you set the number of brightness values to:

pwm_backlight->backlight.brightness_max = length / sizeof(u32);

and then loop through the array with:

for (i = 0; i <=  pwm_backlight->backlight.brightness_max; i++)

to find the max of the array.

I think the '<=' should be a '<' otherwise you access an uninitialized value
one past the end of the array; this actually does not directly crash barebox
but the whole brightness values are scaled wrong.

giorgio

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux