- watchdog-itco_wdt-fix-bug-related-to-gcc-uninit-warning.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled

     watchdog/iTCO_wdt: fix bug related to gcc uninit warning

has been removed from the -mm tree.  Its filename is

     watchdog-itco_wdt-fix-bug-related-to-gcc-uninit-warning.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
Subject: watchdog/iTCO_wdt: fix bug related to gcc uninit warning
From: Jeff Garzik <jeff@xxxxxxxxxx>

gcc emits the following warning:

drivers/char/watchdog/iTCO_wdt.c: In function â??iTCO_wdt_ioctlâ??:
drivers/char/watchdog/iTCO_wdt.c:429: warning: â??time_leftâ?? may be used uninitialized in this function

This indicates a condition near enough to a bug, to want to fix.
iTCO_wdt_get_timeleft() stores a value in 'time_left' iff
iTCO_version==(1 or 2).  This driver only supports versions
1 or 2, so this is ok.  However, since (a) the return value of
iTCO_wdt_get_timeleft() is handled anyway, (b) it fixes the warning,
and (c) it future-proofs the driver, we go ahead and add the obvious
return value.

Signed-off-by: Jeff Garzik <jeff@xxxxxxxxxx>
Cc: Wim Van Sebroeck <wim@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxx>
---

 drivers/char/watchdog/iTCO_wdt.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff -puN drivers/char/watchdog/iTCO_wdt.c~watchdog-itco_wdt-fix-bug-related-to-gcc-uninit-warning drivers/char/watchdog/iTCO_wdt.c
--- a/drivers/char/watchdog/iTCO_wdt.c~watchdog-itco_wdt-fix-bug-related-to-gcc-uninit-warning
+++ a/drivers/char/watchdog/iTCO_wdt.c
@@ -368,7 +368,8 @@ static int iTCO_wdt_get_timeleft (int *t
 		spin_unlock(&iTCO_wdt_private.io_lock);
 
 		*time_left = (val8 * 6) / 10;
-	}
+	} else
+		return -EINVAL;
 	return 0;
 }
 
@@ -439,7 +440,6 @@ static int iTCO_wdt_ioctl (struct inode 
 {
 	int new_options, retval = -EINVAL;
 	int new_heartbeat;
-	int time_left;
 	void __user *argp = (void __user *)arg;
 	int __user *p = argp;
 	static struct watchdog_info ident = {
@@ -499,6 +499,8 @@ static int iTCO_wdt_ioctl (struct inode 
 
 		case WDIOC_GETTIMELEFT:
 		{
+			int time_left;
+
 			if (iTCO_wdt_get_timeleft(&time_left))
 				return -EINVAL;
 
_

Patches currently in -mm which might be from jeff@xxxxxxxxxx are

origin.patch
fix-up-a-multitude-of-acpi-compiler-warnings-on-x86_64.patch
cpufreq-handle-sysfs-errors.patch
drm-fix-error-returns-sysfs-error-handling.patch
git-dvb.patch
drivers-media-video-handle-sysfs-errors.patch
i2c-buses-scx200_acb-handle-pci-errors.patch
input-handle-sysfs-errors.patch
input-drivers-handle-sysfs-errors.patch
git-libata-all.patch
ata-must-depend-on-block.patch
via-pata-controller-xfer-fixes.patch
ahci-ati-sb600-sata-support-for-various-modes.patch
drivers-mmcmisc-handle-pci-errors-on-resume.patch
git-mtd.patch
git-netdev-all.patch
libphy-dont-do-that.patch
update-smc91x-driver-with-arm-versatile-board-info.patch
8139too-force-media-setting-fix.patch
tulip-fix-shutdown-dma-irq-race.patch
drivers-dma-handle-sysfs-errors.patch
atm-firestream-handle-thrown-error.patch
wan-pc300-handle-propagate-minor-errors.patch
pcmcia-handle-sysfs-pci-errors.patch
r8169-driver-corega-support-patch.patch
git-pciseg.patch
scsi-minor-bug-fixes-and-cleanups.patch
mpt-fusion-handle-pci-layer-error-on-resume.patch
git-watchdog.patch
airo-suspend-fix.patch
drivers-led-handle-sysfs-errors.patch
i2o-handle-a-few-sysfs-errors.patch
fs-partitions-check-add-sysfs-error-handling.patch
rtc-fix-printk-of-64-bit-res-on-32-bit-platform.patch
i2o-more-error-checking.patch
pnp-handle-sysfs-errors.patch
isdn-fix-drivers-by-handling-errors-thrown-by-readstat.patch
isdn-check-for-userspace-copy-faults.patch
atyfb-rivafb-minor-fixes.patch
md-conditionalize-some-code.patch
git-gccbug.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux