Skip to content

Commit 0e163e5

Browse files
Tom Rixquic-jhugo
authored andcommitted
accel/qaic: initialize ret variable to 0
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: ff13be8 ("accel/qaic: Add datapath") Signed-off-by: Tom Rix <[email protected]> [jhugo: Reword commit text] Signed-off-by: Jeffrey Hugo <[email protected]> Reviewed-by: Carl Vanderlip <[email protected]> Reviewed-by: Pranjal Ramajor Asha Kanojiya <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent c21f11d commit 0e163e5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/accel/qaic/qaic_data.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ static int qaic_gem_object_mmap(struct drm_gem_object *obj, struct vm_area_struc
591591
struct qaic_bo *bo = to_qaic_bo(obj);
592592
unsigned long offset = 0;
593593
struct scatterlist *sg;
594-
int ret;
594+
int ret = 0;
595595

596596
if (obj->import_attach)
597597
return -EINVAL;

0 commit comments

Comments
 (0)