From 51502143eeb0a5553ab5977d07bf707dac47200c Mon Sep 17 00:00:00 2001 From: David Zeuthen Date: Wed, 9 Dec 2009 17:14:36 -0500 Subject: fix return of uninitialized variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit atasmart.c: In function ‘init_smart’: atasmart.c:2556: warning: ‘ret’ may be used uninitialized in this function We apparently don't initialize the ret variable in init_smart() - unfortunately o this warning is never reported with using -O0 (thanks gcc - see http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings though) o we never run into this bug with just skdump(1) The bug does show up in the udisks (aka DeviceKit-disks) use of libatasmart and this patch fixes it. http://bugs.freedesktop.org/show_bug.cgi?id=25543 --- atasmart.c | 1 + 1 file changed, 1 insertion(+) diff --git a/atasmart.c b/atasmart.c index 3ff0334..d39e704 100644 --- a/atasmart.c +++ b/atasmart.c @@ -2579,6 +2579,7 @@ static int init_smart(SkDisk *d) { } disk_smart_read_thresholds(d); + ret = 0; fail: return ret; -- cgit