backlight: mp3309c: Fix signedness bug in mp3309c_parse_fwnode()
authorDan Carpenter <dan.carpenter@linaro.org>
Sat, 16 Mar 2024 09:45:27 +0000 (12:45 +0300)
committerLee Jones <lee@kernel.org>
Fri, 10 May 2024 14:44:28 +0000 (15:44 +0100)
commite962f13b1e86272a5dcdaede2dfb649152e981e9
tree331a2298f983a8c326abde7911d64b3f7db540bd
parent13cb61bed54d12cd67450ad4612ce0978f9329cb
backlight: mp3309c: Fix signedness bug in mp3309c_parse_fwnode()

The "num_levels" variable is used to store error codes from
device_property_count_u32() so it needs to be signed.  This doesn't
cause an issue at runtime because devm_kcalloc() won't allocate negative
sizes.  However, it's still worth fixing.

Fixes: b54c828bdba9 ("backlight: mp3309c: Make use of device properties")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Tested-by: Flavio Suligoi <f.suligoi@asem.it>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/74347f67-360d-4513-8939-595e3c4764fa@moroto.mountain
Signed-off-by: Lee Jones <lee@kernel.org>
drivers/video/backlight/mp3309c.c