From patchwork Thu Dec 2 13:47:17 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: rtc: rs5c372: fix buffer-size From: Wolfram Sang X-Patchwork-Id: 73972 Message-Id: <1291297637-23432-1-git-send-email-w.sang@pengutronix.de> To: rtc-linux@googlegroups.com Cc: Andre van Rooyen , Peter Korsgaard , Wolfram Sang , Alessandro Zummo , Andrew Morton , stable@kernel.org Date: Thu, 2 Dec 2010 14:47:17 +0100 Match the buffer-size to the amount of initialized values. Before, it was one too big and thus destroyed the neighbouring register causing the clock to run at false speeds. Reported-by: Andre van Rooyen Signed-off-by: Wolfram Sang Cc: Alessandro Zummo Cc: Andrew Morton Cc: stable@kernel.org --- Andre said he was OK with being the reporter and not needing to keep track of this bug. drivers/rtc/rtc-rs5c372.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/rtc/rtc-rs5c372.c b/drivers/rtc/rtc-rs5c372.c index 90cf0a6..dd14e20 100644 --- a/drivers/rtc/rtc-rs5c372.c +++ b/drivers/rtc/rtc-rs5c372.c @@ -207,7 +207,7 @@ static int rs5c372_get_datetime(struct i2c_client *client, struct rtc_time *tm) static int rs5c372_set_datetime(struct i2c_client *client, struct rtc_time *tm) { struct rs5c372 *rs5c = i2c_get_clientdata(client); - unsigned char buf[8]; + unsigned char buf[7]; int addr; dev_dbg(&client->dev, "%s: tm is secs=%d, mins=%d, hours=%d "