Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

rtc: atcrtc100: Fix signedness bug in probe()

The "atcrtc_dev->alarm_irq" variable is an unsigned int but it needs to
be signed for the error handling to work. Use the "ret" variable
instead.

Fixes: 7adca706fe16 ("rtc: atcrtc100: Add ATCRTC100 RTC driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://patch.msgid.link/aRxPGBEX8hbY6sjV@stanley.mountain
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

authored by

Dan Carpenter and committed by
Alexandre Belloni
159a740c f07640f9

+5 -3
+5 -3
drivers/rtc/rtc-atcrtc100.c
··· 296 296 "Failed to initialize RTC: unsupported hardware ID 0x%x\n", 297 297 rtc_id); 298 298 299 - atcrtc_dev->alarm_irq = platform_get_irq(pdev, 1); 300 - if (atcrtc_dev->alarm_irq < 0) 301 - return dev_err_probe(&pdev->dev, atcrtc_dev->alarm_irq, 299 + ret = platform_get_irq(pdev, 1); 300 + if (ret < 0) 301 + return dev_err_probe(&pdev->dev, ret, 302 302 "Failed to get IRQ for alarm\n"); 303 + atcrtc_dev->alarm_irq = ret; 304 + 303 305 ret = devm_request_irq(&pdev->dev, 304 306 atcrtc_dev->alarm_irq, 305 307 atcrtc_alarm_isr,