History

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.

Joshua Kinard committed 11 years ago

Commit b00eeae1 parent 957ed601 file · +2 −2Browse files

Unified · Split

drivers/rtc/rtc-ds1685.c+2−2
@@ -1610,7 +1610,7 @@ ds1685_rtc_sysfs_time_regs_show(struct device *dev, · 1609 unmodified lines
16101610 ds1685_rtc_sysfs_time_regs_lookup(attr->attr.name, false);
16111611
16121612 /* Make sure we actually matched something. */
1613− if (!bcd_reg_info && !bin_reg_info)
1613+ if (!bcd_reg_info || !bin_reg_info)
16141614 return -EINVAL;
16151615
16161616 /* bcd_reg_info->reg == bin_reg_info->reg. */
@@ -1648,7 +1648,7 @@ ds1685_rtc_sysfs_time_regs_store(struct device *dev, · 31 unmodified lines
16481648 return -EINVAL;
16491649
16501650 /* Make sure we actually matched something. */
1651− if (!bcd_reg_info && !bin_reg_info)
1651+ if (!bcd_reg_info || !bin_reg_info)
16521652 return -EINVAL;
16531653
16541654 /* Check for a valid range. */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t