From: Wolfram Sang Date: Wed, 22 Dec 2010 01:24:24 +0000 (-0800) Subject: rtc: rs5c372: fix buffer size X-Git-Tag: v2.6.36.3~31 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=879ef03a76c5169898a121e988f3eaaabb95d73a;p=karo-tx-linux.git rtc: rs5c372: fix buffer size commit 118364948fad7b6c0469ef2d3ddaee447d7a0b5f upstream. 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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/rtc/rtc-rs5c372.c b/drivers/rtc/rtc-rs5c372.c index 90cf0a6ff23e..dd14e202c2c8 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 "