Skip to content

Commit 81233d5

Browse files
committed
accel/amdxdna: Fix uninitialized return value
In aie2_get_hwctx_status() and aie2_query_ctx_status_array(), the functions could return an uninitialized value in some cases. Update them to always return 0. The amount of valid results is indicated by the returned buffer_size, element_size, and num_element fields. Fixes: 2f509fe ("accel/amdxdna: Add ioctl DRM_IOCTL_AMDXDNA_GET_ARRAY") Reviewed-by: Mario Limonciello (AMD) <superm1@kernel.org> Signed-off-by: Lizhi Hou <lizhi.hou@amd.com> Link: https://patch.msgid.link/20251024165503.1548131-1-lizhi.hou@amd.com
1 parent 41ee902 commit 81233d5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/accel/amdxdna/aie2_pci.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,7 @@ static int aie2_get_hwctx_status(struct amdxdna_client *client,
822822
}
823823

824824
args->buffer_size -= (u32)(array_args.buffer - args->buffer);
825-
return ret;
825+
return 0;
826826
}
827827

828828
static int aie2_get_info(struct amdxdna_client *client, struct amdxdna_drm_get_info *args)
@@ -904,7 +904,7 @@ static int aie2_query_ctx_status_array(struct amdxdna_client *client,
904904
args->num_element = (u32)((array_args.buffer - args->buffer) /
905905
args->element_size);
906906

907-
return ret;
907+
return 0;
908908
}
909909

910910
static int aie2_get_array(struct amdxdna_client *client,

0 commit comments

Comments
 (0)