lkml.org 
[lkml]   [2023]   [May]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2] accel/qaic: initialize ret variable to 0
From
On 5/17/2023 10:56 AM, Jeffrey Hugo wrote:
> From: Tom Rix <trix@redhat.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@redhat.com>
> [jhugo: Reword commit text]
> Signed-off-by: Jeffrey Hugo <quic_jhugo@quicinc.com>

Pushed to drm-misc-fixes

\
 
 \ /
  Last update: 2023-05-23 17:58    [W:0.120 / U:0.524 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site