[PATCH] leds: flash: qcom: Fix a signedness bug in qcom_flash_register_led_device()

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

 



This bug is basically harmless at runtime because of the surrounding lines.
Still the fwnode_property_count_u32() function returns negative error codes
so storing them in an unsigned int will not work.

Fixes: 96a2e242a5dc ("leds: flash: Add driver to support flash LED module in QCOM PMICs")
Signed-off-by: Dan Carpenter <error27@xxxxxxxxx>
---
The patch prefix on this was slightly tricky.  Ideally when people add a
new driver the patch which adds the driver would use the patch prefix
for the driver instead of the subsystem:

Not ideal: [PATCH] leds: Add new driver for QWERTY
    Ideal: [PATCH] leds: qwerty: Add new driver

 drivers/leds/flash/leds-qcom-flash.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/leds/flash/leds-qcom-flash.c b/drivers/leds/flash/leds-qcom-flash.c
index 406ed8761c78..4ea33ca88fa8 100644
--- a/drivers/leds/flash/leds-qcom-flash.c
+++ b/drivers/leds/flash/leds-qcom-flash.c
@@ -529,8 +529,9 @@ static int qcom_flash_register_led_device(struct device *dev,
 	struct led_init_data init_data;
 	struct led_classdev_flash *flash = &led->flash;
 	struct led_flash_setting *brightness, *timeout;
-	u32 count, current_ua, timeout_us;
+	u32 current_ua, timeout_us;
 	u32 channels[4];
+	int count;
 	int i, rc;
 
 	count = fwnode_property_count_u32(node, "led-sources");
-- 
2.39.1




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux