+ rtc-ds1685-fix-conditional-in-ds1685_rtc_sysfs_time_regs_showstore.patch added to -mm tree

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

 



The patch titled
     Subject: drivers/rtc/rtc-ds1685.c: fix conditional in ds1685_rtc_sysfs_time_regs_{show,store}
has been added to the -mm tree.  Its filename is
     rtc-ds1685-fix-conditional-in-ds1685_rtc_sysfs_time_regs_showstore.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/rtc-ds1685-fix-conditional-in-ds1685_rtc_sysfs_time_regs_showstore.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/rtc-ds1685-fix-conditional-in-ds1685_rtc_sysfs_time_regs_showstore.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: Joshua Kinard <kumba@xxxxxxxxxx>
Subject: drivers/rtc/rtc-ds1685.c: fix conditional in ds1685_rtc_sysfs_time_regs_{show,store}

Fix a conditional statement checking for NULL in both
ds1685_rtc_sysfs_time_regs_show and ds1685_rtc_sysfs_time_regs_store that
was using a logical AND when it should be using a logical OR so that we
fail out of the function properly if the condition ever evaluates to true.

Fixes: aaaf5fbf56f1 ("rtc: add driver for DS1685 family of real time clocks")
Signed-off-by: Joshua Kinard <kumba@xxxxxxxxxx>
Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 drivers/rtc/rtc-ds1685.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -puN drivers/rtc/rtc-ds1685.c~rtc-ds1685-fix-conditional-in-ds1685_rtc_sysfs_time_regs_showstore drivers/rtc/rtc-ds1685.c
--- a/drivers/rtc/rtc-ds1685.c~rtc-ds1685-fix-conditional-in-ds1685_rtc_sysfs_time_regs_showstore
+++ a/drivers/rtc/rtc-ds1685.c
@@ -1610,7 +1610,7 @@ ds1685_rtc_sysfs_time_regs_show(struct d
 		ds1685_rtc_sysfs_time_regs_lookup(attr->attr.name, false);
 
 	/* Make sure we actually matched something. */
-	if (!bcd_reg_info && !bin_reg_info)
+	if (!bcd_reg_info || !bin_reg_info)
 		return -EINVAL;
 
 	/* bcd_reg_info->reg == bin_reg_info->reg. */
@@ -1648,7 +1648,7 @@ ds1685_rtc_sysfs_time_regs_store(struct
 		return -EINVAL;
 
 	/* Make sure we actually matched something. */
-	if (!bcd_reg_info && !bin_reg_info)
+	if (!bcd_reg_info || !bin_reg_info)
 		return -EINVAL;
 
 	/* Check for a valid range. */
_

Patches currently in -mm which might be from kumba@xxxxxxxxxx are

origin.patch
rtc-ds1685-fix-ds1685_rtc_alarm_irq_enable-build-error.patch
rtc-ds1685-remove-superfluous-checks-for-out-of-range-u8-values.patch
rtc-ds1685-fix-conditional-in-ds1685_rtc_sysfs_time_regs_showstore.patch
mips-ip32-add-platform-data-hooks-to-use-ds1685-driver.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