From: Dan Carpenter <dan.carpenter@linaro.org>
To: CL Wang <cl634@andestech.com>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>,
linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: [PATCH next] rtc: atcrtc100: Fix signedness bug in probe()
Date: Tue, 18 Nov 2025 13:48:56 +0300 [thread overview]
Message-ID: <aRxPGBEX8hbY6sjV@stanley.mountain> (raw)
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>
---
drivers/rtc/rtc-atcrtc100.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/rtc/rtc-atcrtc100.c b/drivers/rtc/rtc-atcrtc100.c
index 51933ae1a2fa..9808fc2c5a49 100644
--- a/drivers/rtc/rtc-atcrtc100.c
+++ b/drivers/rtc/rtc-atcrtc100.c
@@ -296,10 +296,12 @@ static int atcrtc_probe(struct platform_device *pdev)
"Failed to initialize RTC: unsupported hardware ID 0x%x\n",
rtc_id);
- atcrtc_dev->alarm_irq = platform_get_irq(pdev, 1);
- if (atcrtc_dev->alarm_irq < 0)
- return dev_err_probe(&pdev->dev, atcrtc_dev->alarm_irq,
+ ret = platform_get_irq(pdev, 1);
+ if (ret < 0)
+ return dev_err_probe(&pdev->dev, ret,
"Failed to get IRQ for alarm\n");
+ atcrtc_dev->alarm_irq = ret;
+
ret = devm_request_irq(&pdev->dev,
atcrtc_dev->alarm_irq,
atcrtc_alarm_isr,
--
2.51.0
next reply other threads:[~2025-11-18 10:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-18 10:48 Dan Carpenter [this message]
2025-11-19 2:35 ` [PATCH next] rtc: atcrtc100: Fix signedness bug in probe() CL Wang
2025-11-19 7:13 ` Dan Carpenter
2025-12-08 22:08 ` Alexandre Belloni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aRxPGBEX8hbY6sjV@stanley.mountain \
--to=dan.carpenter@linaro.org \
--cc=alexandre.belloni@bootlin.com \
--cc=cl634@andestech.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox