[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <3925582.KR6QxHBrsl@aspire.rjw.lan>
Date: Tue, 19 Sep 2017 01:41:12 +0200
From: "Rafael J. Wysocki" <rjw@...ysocki.net>
To: Mika Westerberg <mika.westerberg@...ux.intel.com>,
Arnd Bergmann <arnd@...db.de>
Cc: Len Brown <lenb@...nel.org>, Ryan Kennedy <ryan5544@...il.com>,
Guenter Roeck <linux@...ck-us.net>, linux-acpi@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] acpi: watchdog: properly initialize resources
On Saturday, September 16, 2017 8:56:49 AM CEST Mika Westerberg wrote:
> On Fri, Sep 15, 2017 at 09:55:18PM +0200, Arnd Bergmann wrote:
> > We copy a local resource structure into a list, but only
> > initialize some of its members, as pointed out by gcc-4.4:
> >
> > drivers/acpi/acpi_watchdog.c: In function 'acpi_watchdog_init':
> > drivers/acpi/acpi_watchdog.c:105: error: 'res.child' may be used uninitialized in this function
> > drivers/acpi/acpi_watchdog.c:105: error: 'res.sibling' may be used uninitialized in this function
> > drivers/acpi/acpi_watchdog.c:105: error: 'res.parent' may be used uninitialized in this function
> > drivers/acpi/acpi_watchdog.c:105: error: 'res.desc' may be used uninitialized in this function
> > drivers/acpi/acpi_watchdog.c:105: error: 'res.name' may be used uninitialized in this function
> >
> > Newer compilers can presumably optimize the uninitialized access
> > away entirely and don't warn at all, but rely on the kzalloc()
> > to zero the structure first. This adds an explicit initialization
> > to force consistent behavior.
> >
> > Fixes: 058dfc767008 ("ACPI / watchdog: Add support for WDAT hardware watchdog")
> > Signed-off-by: Arnd Bergmann <arnd@...db.de>
>
> Acked-by: Mika Westerberg <mika.westerberg@...ux.intel.com>
Applied, thanks!
Powered by blists - more mailing lists