lkml.org 
[lkml]   [2022]   [Feb]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH -next] drm/amdkfd: Fix NULL but dereferenced coccicheck error
From

On 2022-02-08 20:39, Yang Li wrote:
> 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 <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>

Thank you. I already picket up Tom Rix's patch for the same issue.

Regards,
  Felix


> ---
> drivers/gpu/drm/amd/amdkfd/kfd_chardev.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
> index 64e3b4e3a712..636391c61caf 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_chardev.c
> @@ -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) {

\
 
 \ /
  Last update: 2022-02-09 22:17    [W:3.113 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site