From: David Brownell <david-b@pacbell.net>
To: Adrian Bunk <bunk@stusta.de>
Cc: Rodolfo Giometti <giometti@linux.it>,
a.zummo@towertech.it, rtc-linux@googlegroups.com,
linux-kernel@vger.kernel.org
Subject: Re: rtc-ds1307.c: array overrun
Date: Sun, 22 Jul 2007 18:17:17 -0700 [thread overview]
Message-ID: <200707221817.18338.david-b@pacbell.net> (raw)
In-Reply-To: <20070723004422.GR26212@stusta.de>
On Sunday 22 July 2007, Adrian Bunk wrote:
> The Coverity checker spotted the following array overrun
> in drivers/rtc/rtc-ds1307.c:
Typo -- thanks, fix is attached.
======== CUT HERE
Fix a typo turned up by a Coverity check: referring to the wrong register,
which could cause problems restarting DS1338 RTCs after their oscillator
halted. (For example, if the backup battery died.)
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
---
drivers/rtc/rtc-ds1307.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- g26.orig/drivers/rtc/rtc-ds1307.c 2007-07-22 18:10:09.000000000 -0700
+++ g26/drivers/rtc/rtc-ds1307.c 2007-07-22 18:10:21.000000000 -0700
@@ -352,7 +352,7 @@ read_rtc:
/* oscillator fault? clear flag, and warn */
if (ds1307->regs[DS1307_REG_CONTROL] & DS1338_BIT_OSF) {
i2c_smbus_write_byte_data(client, DS1307_REG_CONTROL,
- ds1307->regs[DS1337_REG_CONTROL]
+ ds1307->regs[DS1307_REG_CONTROL]
& ~DS1338_BIT_OSF);
dev_warn(&client->dev, "SET TIME!\n");
goto read_rtc;
next prev parent reply other threads:[~2007-07-23 1:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-23 0:44 rtc-ds1307.c: array overrun Adrian Bunk
2007-07-23 1:17 ` David Brownell [this message]
2007-07-25 1:37 ` [rtc-linux] " Alessandro Zummo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200707221817.18338.david-b@pacbell.net \
--to=david-b@pacbell.net \
--cc=a.zummo@towertech.it \
--cc=bunk@stusta.de \
--cc=giometti@linux.it \
--cc=linux-kernel@vger.kernel.org \
--cc=rtc-linux@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox