[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <cd8192e3-7d7d-5976-d795-05d4459cffea@quicinc.com>
Date: Tue, 23 May 2023 09:56:16 -0600
From: Jeffrey Hugo <quic_jhugo@...cinc.com>
To: <trix@...hat.com>, <ogabbay@...nel.org>, <nathan@...nel.org>,
<ndesaulniers@...gle.com>, <jacek.lawrynowicz@...ux.intel.com>,
<quic_carlv@...cinc.com>, <stanislaw.gruszka@...ux.intel.com>,
<quic_pkanojiy@...cinc.com>
CC: <linux-arm-msm@...r.kernel.org>, <dri-devel@...ts.freedesktop.org>,
<linux-kernel@...r.kernel.org>, <llvm@...ts.linux.dev>
Subject: Re: [PATCH v2] accel/qaic: initialize ret variable to 0
On 5/17/2023 10:56 AM, Jeffrey Hugo wrote:
> From: Tom Rix <trix@...hat.com>
>
> clang static analysis reports
> drivers/accel/qaic/qaic_data.c:610:2: warning: Undefined or garbage
> value returned to caller [core.uninitialized.UndefReturn]
> return ret;
> ^~~~~~~~~~
>
> From a code analysis of the function, the ret variable is only set some
> of the time but is always returned. This suggests ret can return
> uninitialized garbage. However BO allocation will ensure ret is always
> set in reality.
>
> Initialize ret to 0 to silence the warning.
>
> Fixes: ff13be830333 ("accel/qaic: Add datapath")
> Signed-off-by: Tom Rix <trix@...hat.com>
> [jhugo: Reword commit text]
> Signed-off-by: Jeffrey Hugo <quic_jhugo@...cinc.com>
Pushed to drm-misc-fixes
Powered by blists - more mailing lists