[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <63ebb86432d39_32d61294ba@dwillia2-xfh.jf.intel.com.notmuch>
Date: Tue, 14 Feb 2023 08:35:48 -0800
From: Dan Williams <dan.j.williams@...el.com>
To: Arnd Bergmann <arnd@...nel.org>,
Alison Schofield <alison.schofield@...el.com>,
Vishal Verma <vishal.l.verma@...el.com>,
"Ira Weiny" <ira.weiny@...el.com>,
Ben Widawsky <bwidawsk@...nel.org>,
Dan Williams <dan.j.williams@...el.com>,
Jonathan Cameron <Jonathan.Cameron@...wei.com>
CC: Arnd Bergmann <arnd@...db.de>, Dave Jiang <dave.jiang@...el.com>,
"Dan Carpenter" <error27@...il.com>, <linux-cxl@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] cxl: avoid returning uninitialized error code
Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@...db.de>
>
> The new cxl_add_to_region() function returns an uninitialized
> value on success:
>
> drivers/cxl/core/region.c:2628:6: error: variable 'rc' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized]
> if (IS_ERR(cxlr)) {
> ^~~~~~~~~~~~
> drivers/cxl/core/region.c:2654:9: note: uninitialized use occurs here
> return rc;
>
> Simplify the logic to have the rc variable always initialized in the
> same place.
>
> Fixes: a32320b71f08 ("cxl/region: Add region autodiscovery")
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
Looks good, thanks Arnd.
Powered by blists - more mailing lists