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
1610 ds1685_rtc_sysfs_time_regs_lookup(attr->attr.name, false);1610 ds1685_rtc_sysfs_time_regs_lookup(attr->attr.name, false);
1611 1611
1612 /* Make sure we actually matched something. */1612 /* Make sure we actually matched something. */
1613 if (!bcd_reg_info && !bin_reg_info)1613 if (!bcd_reg_info || !bin_reg_info)
1614 return -EINVAL;1614 return -EINVAL;
1615 1615
1616 /* bcd_reg_info->reg == bin_reg_info->reg. */1616 /* bcd_reg_info->reg == bin_reg_info->reg. */
@@ -1648,7 +1648,7 @@ ds1685_rtc_sysfs_time_regs_store(struct device *dev, · 31 unmodified lines
1648 return -EINVAL;1648 return -EINVAL;
1649 1649
1650 /* Make sure we actually matched something. */1650 /* Make sure we actually matched something. */
1651 if (!bcd_reg_info && !bin_reg_info)1651 if (!bcd_reg_info || !bin_reg_info)
1652 return -EINVAL;1652 return -EINVAL;
1653 1653
1654 /* Check for a valid range. */1654 /* 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