+ drivers-rtc-interfacec-check-the-validation-of-rtc_time-in-__rtc_read_time.patch added to -mm tree

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

 



The patch titled
     Subject: drivers/rtc/interface.c: check the validation of rtc_time in __rtc_read_time
has been added to the -mm tree.  Its filename is
     drivers-rtc-interfacec-check-the-validation-of-rtc_time-in-__rtc_read_time.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/drivers-rtc-interfacec-check-the-validation-of-rtc_time-in-__rtc_read_time.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/drivers-rtc-interfacec-check-the-validation-of-rtc_time-in-__rtc_read_time.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Hyogi Gim <ciogenis@xxxxxxxxx>
Subject: drivers/rtc/interface.c: check the validation of rtc_time in __rtc_read_time

Some rtc devices always return '0' when rtc_class_ops.read_time is called.
So if rtc_time isn't verified in callback, rtc interface cannot know
whether rtc_time is valid.

Check rtc_time by using 'rtc_valid_tm' in '__rtc_read_time'.  And add the
message for debugging.

Signed-off-by: Hyogi Gim <hyogi.gim@xxxxxxx>
Cc: Alessandro Zummo <a.zummo@xxxxxxxxxxxx>
Cc: John Stultz <john.stultz@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 drivers/rtc/interface.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff -puN drivers/rtc/interface.c~drivers-rtc-interfacec-check-the-validation-of-rtc_time-in-__rtc_read_time drivers/rtc/interface.c
--- a/drivers/rtc/interface.c~drivers-rtc-interfacec-check-the-validation-of-rtc_time-in-__rtc_read_time
+++ a/drivers/rtc/interface.c
@@ -30,6 +30,14 @@ static int __rtc_read_time(struct rtc_de
 	else {
 		memset(tm, 0, sizeof(struct rtc_time));
 		err = rtc->ops->read_time(rtc->dev.parent, tm);
+		if (err < 0) {
+			dev_err(&rtc->dev, "read_time: fail to read\n");
+			return err;
+		}
+
+		err = rtc_valid_tm(tm);
+		if (err < 0)
+			dev_err(&rtc->dev, "read_time: rtc_time isn't valid\n");
 	}
 	return err;
 }
_

Patches currently in -mm which might be from ciogenis@xxxxxxxxx are

drivers-rtc-interfacec-check-the-validation-of-rtc_time-in-__rtc_read_time.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux