From: zhoucm1 <zhoucm1-5C7GfCeVMHo@public.gmane.org>
To: "Sharma, Deepak" <Deepak.Sharma-5C7GfCeVMHo@public.gmane.org>,
"amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org"
<amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>,
"Zhou,
David(ChunMing)" <David1.Zhou-5C7GfCeVMHo@public.gmane.org>
Subject: Re: [PATCH] drm/amdgpu: add the checking to avoid NULL pointer dereference
Date: Thu, 22 Nov 2018 15:00:40 +0800 [thread overview]
Message-ID: <881e2f9e-6c00-f3ad-a6aa-345accb6f4a5@amd.com> (raw)
In-Reply-To: <20181122065523.5510-1-Deepak.Sharma-5C7GfCeVMHo@public.gmane.org>
On 2018年11月22日 14:56, Sharma, Deepak wrote:
> when returned fence is not valid mostly due to userspace ignored
> previous error causes NULL pointer dereference.
>
> Signed-off-by: Deepak Sharma <Deepak.Sharma@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> index 024dfbd87f11..14166cd8a12f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
> @@ -1403,6 +1403,8 @@ static struct dma_fence *amdgpu_cs_get_fence(struct amdgpu_device *adev,
>
> fence = amdgpu_ctx_get_fence(ctx, entity, user->seq_no);
> amdgpu_ctx_put(ctx);
> + if(!fence)
> + return ERR_PTR(-EINVAL);
>
> return fence;
> }
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2018-11-22 7:00 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-22 6:56 [PATCH] drm/amdgpu: add the checking to avoid NULL pointer dereference Sharma, Deepak
[not found] ` <20181122065523.5510-1-Deepak.Sharma-5C7GfCeVMHo@public.gmane.org>
2018-11-22 7:00 ` zhoucm1 [this message]
2018-11-22 11:25 ` Christian König
[not found] ` <b8284caa-3f1d-5672-6317-36be83907e9d-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-11-23 13:27 ` Chunming Zhou
[not found] ` <9350d13a-e745-f284-1c49-785fe523773d-5C7GfCeVMHo@public.gmane.org>
2018-11-23 13:30 ` Koenig, Christian
[not found] ` <eae25687-23ce-d686-f5f0-deeb7c3d2e1c-5C7GfCeVMHo@public.gmane.org>
2018-11-23 14:10 ` Chunming Zhou
[not found] ` <70a32625-7568-6253-6c5e-a72fe38f7986-5C7GfCeVMHo@public.gmane.org>
2018-11-23 18:10 ` Koenig, Christian
[not found] ` <138bad33-c604-c0c5-98cb-1ce71a432185-5C7GfCeVMHo@public.gmane.org>
2018-11-24 8:14 ` Chunming Zhou
[not found] ` <46007826-1a4a-40eb-5ee8-af2d0c93e04a-5C7GfCeVMHo@public.gmane.org>
2018-11-26 1:59 ` Sharma, Deepak
[not found] ` <BY2PR12MB0694DBE621FC3BBC269E7D51E9D70-K//h7OWB4q7S9h1UXvMT+AdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-11-26 9:23 ` Christian König
[not found] ` <38725288-c15f-58be-7d1a-422abe503a04-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-11-26 9:57 ` Zhou, David(ChunMing)
[not found] ` <BY1PR12MB0502AC0F928B517E35C58751B4D70-PicGAnIBOobrCwm+z9iKNgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-11-27 0:40 ` Deepak Sharma
[not found] ` <9619e159-d47b-2078-974d-0d3b418f6d88-5C7GfCeVMHo@public.gmane.org>
2018-11-27 2:40 ` zhoucm1
[not found] ` <174e311d-3214-1e70-c5d4-8b955b926a58-5C7GfCeVMHo@public.gmane.org>
2018-11-27 23:12 ` Sharma, Deepak
[not found] ` <BY2PR12MB06942FD453E4656A310A806AE9D00-K//h7OWB4q7S9h1UXvMT+AdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org>
2018-12-01 3:42 ` Sharma, Deepak
2018-11-27 9:52 ` Christian König
[not found] ` <869bef1b-26f4-0fff-fa33-2720c2114a60-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-11-27 23:18 ` Sharma, Deepak
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=881e2f9e-6c00-f3ad-a6aa-345accb6f4a5@amd.com \
--to=zhoucm1-5c7gfcevmho@public.gmane.org \
--cc=David1.Zhou-5C7GfCeVMHo@public.gmane.org \
--cc=Deepak.Sharma-5C7GfCeVMHo@public.gmane.org \
--cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.