From: Andrew Morton <akpm@linux-foundation.org>
To: Hyogi Gim <hyogi.gim@lge.com>
Cc: a.zummo@towertech.it, rtc-linux@googlegroups.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drivers/rtc/interface.c: check the error after __rtc_read_time()
Date: Wed, 17 Dec 2014 13:51:50 -0800 [thread overview]
Message-ID: <20141217135150.b02a4581cebd819f0f8f078a@linux-foundation.org> (raw)
In-Reply-To: <20141217031524.GA22361@lge.com>
On Wed, 17 Dec 2014 12:15:24 +0900 Hyogi Gim <hyogi.gim@lge.com> wrote:
> Add the verification code for returned __rtc_read_time() error in
> rtc_update_irq_enable() and rtc_timer_do_work().
>
> ...
L
> --- a/drivers/rtc/interface.c
> +++ b/drivers/rtc/interface.c
> @@ -489,7 +489,10 @@ int rtc_update_irq_enable(struct rtc_device *rtc, unsigned int enabled)
> struct rtc_time tm;
> ktime_t now, onesec;
>
> - __rtc_read_time(rtc, &tm);
> + err = __rtc_read_time(rtc, &tm);
> + if (err < 0)
> + goto out;
> +
> onesec = ktime_set(1, 0);
> now = rtc_tm_to_ktime(tm);
> rtc->uie_rtctimer.node.expires = ktime_add(now, onesec);
I'm not sure about this part. If __rtc_read_time() returns -EINVAL
(due to !rtc->ops->read_time) then rtc_update_irq_enable() will go and
call rtc_dev_update_irq_enable_emul(), inappropriately.
On the other hand, if __rtc_read_time() returns -EINVAL because that's
what rtc->ops->read_time() returned then perhaps
rtc_update_irq_enable() *should* call rtc_dev_update_irq_enable_emul().
Messy.
next prev parent reply other threads:[~2014-12-17 21:51 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-17 3:15 Hyogi Gim
2014-12-17 21:51 ` Andrew Morton [this message]
2014-12-22 2:43 ` Hyogi Gim
-- strict thread matches above, loose matches on Subject: below --
2014-07-04 1:22 Hyogi Gim
2014-07-30 17:44 ` John Stultz
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=20141217135150.b02a4581cebd819f0f8f078a@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=a.zummo@towertech.it \
--cc=hyogi.gim@lge.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rtc-linux@googlegroups.com \
/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
all inboxes | Powered by JetHome®