mirror of
https://github.com/torvalds/linux.git
synced 2026-05-25 07:33:19 +02:00
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: 2f509fe6a4 ("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
This commit is contained in:
parent
41ee90230c
commit
81233d5419
|
|
@ -822,7 +822,7 @@ static int aie2_get_hwctx_status(struct amdxdna_client *client,
|
|||
}
|
||||
|
||||
args->buffer_size -= (u32)(array_args.buffer - args->buffer);
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
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,
|
|||
args->num_element = (u32)((array_args.buffer - args->buffer) /
|
||||
args->element_size);
|
||||
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int aie2_get_array(struct amdxdna_client *client,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user