[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <SN6PR02MB4576FB4490F96E593E09D4B9C2109@SN6PR02MB4576.namprd02.prod.outlook.com>
Date: Tue, 15 Mar 2022 11:48:11 +0000
From: Nava kishore Manne <navam@...inx.com>
To: Xu Yilun <yilun.xu@...el.com>
CC: "mdf@...nel.org" <mdf@...nel.org>,
"hao.wu@...el.com" <hao.wu@...el.com>,
"trix@...hat.com" <trix@...hat.com>,
Michal Simek <michals@...inx.com>,
"linux-fpga@...r.kernel.org" <linux-fpga@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>
Subject: RE: [PATCH 2/6] fpga: zynqmp: Initialized variables before using it
Hi Yilun,
Thanks for providing the review comments.
Please find my response inline.
> -----Original Message-----
> From: Xu Yilun <yilun.xu@...el.com>
> Sent: Friday, March 11, 2022 7:58 PM
> To: Nava kishore Manne <navam@...inx.com>
> Cc: mdf@...nel.org; hao.wu@...el.com; trix@...hat.com; Michal Simek
> <michals@...inx.com>; linux-fpga@...r.kernel.org; linux-
> kernel@...r.kernel.org; linux-arm-kernel@...ts.infradead.org
> Subject: Re: [PATCH 2/6] fpga: zynqmp: Initialized variables before using it
>
> On Tue, Mar 08, 2022 at 03:15:15PM +0530, Nava kishore Manne wrote:
> > This patch initialized variables with the proper value.
> > Addresses-Coverity: "uninit_use: Using uninitialized value"
> >
> > Signed-off-by: Nava kishore Manne <nava.manne@...inx.com>
> > ---
> > drivers/fpga/zynqmp-fpga.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/fpga/zynqmp-fpga.c b/drivers/fpga/zynqmp-fpga.c
> > index c60f20949c47..e931d69819a7 100644
> > --- a/drivers/fpga/zynqmp-fpga.c
> > +++ b/drivers/fpga/zynqmp-fpga.c
> > @@ -41,7 +41,7 @@ static int zynqmp_fpga_ops_write(struct
> fpga_manager *mgr,
> > const char *buf, size_t size)
> > {
> > struct zynqmp_fpga_priv *priv;
> > - dma_addr_t dma_addr;
> > + dma_addr_t dma_addr = 0;
>
> The first use of this variable is as an output parameter:
>
> kbuf = dma_alloc_coherent(priv->dev, size, &dma_addr,
> GFP_KERNEL);
>
> So I don't think it needs to be initialized as 0.
>
This issue is found by Coverity Scan, Whether this param is input/output this fix will not impact the actual functionality.
In order to fix the issues reported by the Coverity tool, this fix is needed.
Regards,
Navakishore.
Powered by blists - more mailing lists