From 417607d05f41dbe2acccdb7a298a81d30ba1d22b Mon Sep 17 00:00:00 2001 From: "Maciej W. Rozycki" Date: Mon, 12 May 2008 14:02:35 -0700 Subject: RTC/watchdog: M41T80: fix a potential use of unitialized data Watchdog handlers within the driver make use of "save_client" -- make sure it has been initalized before the handlers are registered. Signed-off-by: Maciej W. Rozycki Cc: Alessandro Zummo Cc: Alexander Bigga Cc: Wim Van Sebroeck Cc: David Brownell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/rtc/rtc-m41t80.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/rtc/rtc-m41t80.c') diff --git a/drivers/rtc/rtc-m41t80.c b/drivers/rtc/rtc-m41t80.c index 316bfaa80872..3d451ece253c 100644 --- a/drivers/rtc/rtc-m41t80.c +++ b/drivers/rtc/rtc-m41t80.c @@ -803,6 +803,7 @@ static int m41t80_probe(struct i2c_client *client, #ifdef CONFIG_RTC_DRV_M41T80_WDT if (clientdata->features & M41T80_FEATURE_HT) { + save_client = client; rc = misc_register(&wdt_dev); if (rc) goto exit; @@ -811,7 +812,6 @@ static int m41t80_probe(struct i2c_client *client, misc_deregister(&wdt_dev); goto exit; } - save_client = client; } #endif return 0; -- cgit v1.2.3 From 9fb1f68d40d9dd99fdbf65349c9c6af760e19e6e Mon Sep 17 00:00:00 2001 From: "Maciej W. Rozycki" Date: Mon, 12 May 2008 14:02:38 -0700 Subject: rtc: m41t80: include for printk() The driver uses printk(), but does not include -- add it. Signed-off-by: Maciej W. Rozycki Cc: Alessandro Zummo Cc: Alexander Bigga Cc: Wim Van Sebroeck Cc: David Brownell Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/rtc/rtc-m41t80.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/rtc/rtc-m41t80.c') diff --git a/drivers/rtc/rtc-m41t80.c b/drivers/rtc/rtc-m41t80.c index 3d451ece253c..a3e0880b38fb 100644 --- a/drivers/rtc/rtc-m41t80.c +++ b/drivers/rtc/rtc-m41t80.c @@ -15,6 +15,7 @@ #include #include +#include #include #include #include -- cgit v1.2.3