aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Kuehling <[email protected]>2022-02-18 17:25:23 -0500
committerAlex Deucher <[email protected]>2022-02-22 14:40:44 -0500
commit22804e03f7a5ed35d86721d037bbf52fbfd0369f (patch)
treee02bb4f01e595df54f4172678d2110974b7eea8f
parent757f9e4dd51644729d27c9b5e56f75681e8f17d0 (diff)
drm/amdkfd: Fix criu_restore_bo error handling
Clang static analysis reports this problem kfd_chardev.c:2327:2: warning: 1st function call argument is an uninitialized value kvfree(bo_privs); ^~~~~~~~~~~~~~~~ Make sure bo_buckets and bo_privs are initialized so freeing them in the error handling code path will never result in undefined behaviour. Fixes: 73fa13b6a511 ("drm/amdkfd: CRIU Implement KFD restore ioctl") Reported-by: Tom Rix <[email protected]> Signed-off-by: Felix Kuehling <[email protected]> Reviewed-by: Rajneesh Bhardwaj <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
-rw-r--r--drivers/gpu/drm/amd/amdkfd/kfd_chardev.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
index 965af2a08bc0..7affec907fd1 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
@@ -2097,8 +2097,8 @@ static int criu_restore_bos(struct kfd_process *p,
uint64_t *priv_offset,
uint64_t max_priv_data_size)
{
- struct kfd_criu_bo_bucket *bo_buckets;
- struct kfd_criu_bo_priv_data *bo_privs;
+ struct kfd_criu_bo_bucket *bo_buckets = NULL;
+ struct kfd_criu_bo_priv_data *bo_privs = NULL;
const bool criu_resume = true;
bool flush_tlbs = false;
int ret = 0, j = 0;