drm/amdkfd: Fix NULL but dereferenced coccicheck error
Subsystems (3)
PATCH 1/1 drm/amdkfd: Fix NULL but dereferenced coccicheck error
Eliminate the following coccicheck warning:
./drivers/gpu/drm/amd/amdkfd/kfd_chardev.c:2087:27-38: ERROR: bo_buckets is NULL but dereferenced.
Reported-by Abaci Robot <[email protected]>
Signed-off-by Yang Li <[email protected]>
--- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +2 -4
@@ -1982,10 +1982,8 @@ static int criu_checkpoint_bos(struct kfd_process *p,void *mem; bo_buckets =kvzalloc (num_bos *sizeof (*bo_buckets),GFP_KERNEL ); -if (!bo_buckets) { - ret = -ENOMEM ; - goto exit; - } +if (!bo_buckets) +return -ENOMEM ; bo_privs =kvzalloc (num_bos *sizeof (*bo_privs),GFP_KERNEL );if (!bo_privs) {
Signature · 1 line
2.20.1.7.g153144c
Felix Kuehling
maintainerQuoted 6 lines · Yang Li
Eliminate the following coccicheck warning:
./drivers/gpu/drm/amd/amdkfd/kfd_chardev.c:2087:27-38: ERROR:bo_bucketsis NULL but dereferenced.Reported-by Abaci Robot <[email protected]>Signed-off-by Yang Li <[email protected]>
Thank you. I already picket up Tom Rix's patch for the same issue.
Regards,
Felix
Quoted 21 lines
--- drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdkfd/kfd_chardev.c +2
-4@@ -1982,10 +1982,8 @@ static int criu_checkpoint_bos(struct kfd_process *p,void *mem; bo_buckets =kvzalloc (num_bos *sizeof (*bo_buckets),GFP_KERNEL ); -if (!bo_buckets) { - ret = -ENOMEM ; - goto exit; - } +if (!bo_buckets) +return -ENOMEM ; bo_privs =kvzalloc (num_bos *sizeof (*bo_privs),GFP_KERNEL );if (!bo_privs) {