AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Khatri, Sunil" <sukhatri@amd.com>
To: "Sunil Khatri" <sunil.khatri@amd.com>,
	"Christian König" <christian.koenig@amd.com>,
	"Felix Kuehling" <felix.kuehling@amd.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Arunpravin Paneer Selvam" <Arunpravin.PaneerSelvam@amd.com>,
	amd-gfx@lists.freedesktop.org,
	"Philip Yang" <Philip.Yang@amd.com>
Subject: Re: [Patch v1] drm/amdkfd: add missing return value check for range
Date: Fri, 24 Oct 2025 16:39:37 +0530	[thread overview]
Message-ID: <f8b2a650-ab29-40f3-9e12-2fdbdb287fae@amd.com> (raw)
In-Reply-To: <20251024044720.1971409-1-sunil.khatri@amd.com>

+philip

On 24-10-2025 10:17 am, Sunil Khatri wrote:
> amdgpu_hmm_range_alloc could fails in case of low
> memory condition and hence we should have a check
> for the return value.
>
> Signed-off-by: Sunil Khatri <sunil.khatri@amd.com>
> ---
>   drivers/gpu/drm/amd/amdkfd/kfd_svm.c | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
> index f041643308ca..bc07aa3af2ab 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_svm.c
> @@ -1738,6 +1738,9 @@ static int svm_range_validate_and_map(struct mm_struct *mm,
>   
>   			WRITE_ONCE(p->svms.faulting_task, current);
>   			range = amdgpu_hmm_range_alloc(NULL);
> +			if (unlikely(!range))
> +				return -ENOMEM;
> +
>   			r = amdgpu_hmm_range_get_pages(&prange->notifier, addr, npages,
>   						       readonly, owner,
>   						       range);

  reply	other threads:[~2025-10-24 11:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-24  4:47 [Patch v1] drm/amdkfd: add missing return value check for range Sunil Khatri
2025-10-24 11:09 ` Khatri, Sunil [this message]
2025-10-27 14:43   ` Christian König

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=f8b2a650-ab29-40f3-9e12-2fdbdb287fae@amd.com \
    --to=sukhatri@amd.com \
    --cc=Arunpravin.PaneerSelvam@amd.com \
    --cc=Philip.Yang@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=felix.kuehling@amd.com \
    --cc=sunil.khatri@amd.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