From: Felix Kuehling <felix.kuehling@amd.com>
To: Yang Li <yang.lee@linux.alibaba.com>, daniel@ffwll.ch
Cc: airlied@linux.ie, alexander.deucher@amd.com,
christian.koenig@amd.com, Xinhui.Pan@amd.com,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org,
Abaci Robot <abaci@linux.alibaba.com>
Subject: Re: [PATCH -next] drm/amdkfd: Fix NULL but dereferenced coccicheck error
Date: Wed, 9 Feb 2022 16:14:49 -0500 [thread overview]
Message-ID: <8622afaf-6448-8932-9971-6bfaaa8c311a@amd.com> (raw)
In-Reply-To: <20220209013940.71348-1-yang.lee@linux.alibaba.com>
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) {
prev parent reply other threads:[~2022-02-09 21:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-09 1:39 Yang Li
2022-02-09 21:14 ` Felix Kuehling [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8622afaf-6448-8932-9971-6bfaaa8c311a@amd.com \
--to=felix.kuehling@amd.com \
--cc=Xinhui.Pan@amd.com \
--cc=abaci@linux.alibaba.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=yang.lee@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®