lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1510171094-4859-1-git-send-email-akshay.bhat@timesys.com>
Date:   Wed,  8 Nov 2017 14:58:14 -0500
From:   Akshay Bhat <akshay.bhat@...esys.com>
To:     a.zummo@...ertech.it, alexandre.belloni@...e-electrons.com
Cc:     linux-rtc@...r.kernel.org, linux-kernel@...r.kernel.org,
        Akshay Bhat <akshay.bhat@...esys.com>
Subject: [PATCH v2] rtc: rx8010: Fix for incorrect return value

The err variable is not being reset after a successful read. Explicitly
return 0 at the end of function call to account for all return paths.

Reported-by: Jens-Peter Oswald <oswald@....de>
Signed-off-by: Akshay Bhat <akshay.bhat@...esys.com>
---
v2: Address comments from Alexandre Belloni
- Return 0 at end of function instead of resetting err variable

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

diff --git a/drivers/rtc/rtc-rx8010.c b/drivers/rtc/rtc-rx8010.c
index 2e06e5f..5c5938a 100644
--- a/drivers/rtc/rtc-rx8010.c
+++ b/drivers/rtc/rtc-rx8010.c
@@ -247,7 +247,7 @@ static int rx8010_init_client(struct i2c_client *client)
 
 	rx8010->ctrlreg = (ctrl[1] & ~RX8010_CTRL_TEST);
 
-	return err;
+	return 0;
 }
 
 static int rx8010_read_alarm(struct device *dev, struct rtc_wkalrm *t)
@@ -276,7 +276,7 @@ static int rx8010_read_alarm(struct device *dev, struct rtc_wkalrm *t)
 	t->enabled = !!(rx8010->ctrlreg & RX8010_CTRL_AIE);
 	t->pending = (flagreg & RX8010_FLAG_AF) && t->enabled;
 
-	return err;
+	return 0;
 }
 
 static int rx8010_set_alarm(struct device *dev, struct rtc_wkalrm *t)
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ