From: Felix Kuehling <felix.kuehling@amd.com>
To: "Colin King" <colin.king@canonical.com>,
"Alex Deucher" <alexander.deucher@amd.com>,
"Christian König" <christian.koenig@amd.com>,
"David Airlie" <airlied@linux.ie>,
"Daniel Vetter" <daniel@ffwll.ch>,
"Alex Sierra" <alex.sierra@amd.com>,
"Philip Yang" <Philip.Yang@amd.com>,
amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH][next] drm/amdkfd: fix uint32 variable compared to less than zero
Date: Thu, 22 Apr 2021 15:42:45 -0400 [thread overview]
Message-ID: <ec8393c8-f980-cb56-6b7e-c2c5f29fca78@amd.com> (raw)
In-Reply-To: <20210422123158.247332-1-colin.king@canonical.com>
Am 2021-04-22 um 8:31 a.m. schrieb Colin King:
> From: Colin Ian King <colin.king@canonical.com>
>
> Currently the call to kfd_process_gpuidx_from_gpuid is returning an
> int value and this is being assigned to a uint32_t variable gpuidx
> and this is being checked for a negative error return which is always
> going to be false. Fix this by making gpuidx an int32_t. This makes
> gpuidx also type consistent with the use of gpuidx from the callers.
>
> Addresses-Coverity: ("Unsigned compared against 0")
> Fixes: cda0f85bfa5e ("drm/amdkfd: refine migration policy with xnack on")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
Applied to amd-staging-drm-next.
Thanks,
Felix
> ---
> drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
> index 0e0b4ffd20ab..bf3c8de85b4a 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
> @@ -1330,7 +1330,7 @@ static void svm_range_unreserve_bos(struct svm_validate_context *ctx)
> */
> static int svm_range_validate_and_map(struct mm_struct *mm,
> struct svm_range *prange,
> - uint32_t gpuidx, bool intr, bool wait)
> + int32_t gpuidx, bool intr, bool wait)
> {
> struct svm_validate_context ctx;
> struct hmm_range *hmm_range;
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
prev parent reply other threads:[~2021-04-22 19:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-22 12:31 [PATCH][next] drm/amdkfd: fix uint32 variable compared to less than zero Colin King
2021-04-22 19:42 ` 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=ec8393c8-f980-cb56-6b7e-c2c5f29fca78@amd.com \
--to=felix.kuehling@amd.com \
--cc=Philip.Yang@amd.com \
--cc=airlied@linux.ie \
--cc=alex.sierra@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=colin.king@canonical.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).