* [PATCH -next] drm/amd/display: Fix possible memleak in dp_trigger_hotplug()
@ 2020-09-10 3:26 YueHaibing
2020-09-10 15:34 ` Harry Wentland
0 siblings, 1 reply; 3+ messages in thread
From: YueHaibing @ 2020-09-10 3:26 UTC (permalink / raw)
To: harry.wentland, sunpeng.li, alexander.deucher, christian.koenig,
airlied, daniel, mikita.lipski, eryk.brol
Cc: amd-gfx, dri-devel, linux-kernel, YueHaibing
If parse_write_buffer_into_params() fails, we should free
wr_buf before return.
Fixes: 6f77b2ac6280 ("drm/amd/display: Add connector HPD trigger debugfs entry")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
index 83da24aced45..11e16fbe484d 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
@@ -1089,8 +1089,10 @@ static ssize_t dp_trigger_hotplug(struct file *f, const char __user *buf,
if (parse_write_buffer_into_params(wr_buf, wr_buf_size,
(long *)param, buf,
max_param_num,
- ¶m_nums))
+ ¶m_nums)) {
+ kfree(wr_buf);
return -EINVAL;
+ }
if (param_nums <= 0) {
DRM_DEBUG_DRIVER("user data not be read\n");
--
2.17.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next] drm/amd/display: Fix possible memleak in dp_trigger_hotplug()
2020-09-10 3:26 [PATCH -next] drm/amd/display: Fix possible memleak in dp_trigger_hotplug() YueHaibing
@ 2020-09-10 15:34 ` Harry Wentland
2020-09-15 19:44 ` Alex Deucher
0 siblings, 1 reply; 3+ messages in thread
From: Harry Wentland @ 2020-09-10 15:34 UTC (permalink / raw)
To: YueHaibing, sunpeng.li, alexander.deucher, christian.koenig,
airlied, daniel, mikita.lipski, eryk.brol
Cc: amd-gfx, dri-devel, linux-kernel
On 2020-09-09 11:26 p.m., YueHaibing wrote:
> If parse_write_buffer_into_params() fails, we should free
> wr_buf before return.
>
> Fixes: 6f77b2ac6280 ("drm/amd/display: Add connector HPD trigger debugfs entry")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Harry
> ---
> drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
> index 83da24aced45..11e16fbe484d 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
> @@ -1089,8 +1089,10 @@ static ssize_t dp_trigger_hotplug(struct file *f, const char __user *buf,
> if (parse_write_buffer_into_params(wr_buf, wr_buf_size,
> (long *)param, buf,
> max_param_num,
> - ¶m_nums))
> + ¶m_nums)) {
> + kfree(wr_buf);
> return -EINVAL;
> + }
>
> if (param_nums <= 0) {
> DRM_DEBUG_DRIVER("user data not be read\n");
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH -next] drm/amd/display: Fix possible memleak in dp_trigger_hotplug()
2020-09-10 15:34 ` Harry Wentland
@ 2020-09-15 19:44 ` Alex Deucher
0 siblings, 0 replies; 3+ messages in thread
From: Alex Deucher @ 2020-09-15 19:44 UTC (permalink / raw)
To: Harry Wentland
Cc: YueHaibing, Leo (Sunpeng) Li, Deucher, Alexander,
Christian Koenig, Dave Airlie, Daniel Vetter, Lipski, Mikita,
Eryk Brol, Maling list - DRI developers, amd-gfx list, LKML
Applied. Thanks,
Alex
On Thu, Sep 10, 2020 at 11:34 AM Harry Wentland <harry.wentland@amd.com> wrote:
>
> On 2020-09-09 11:26 p.m., YueHaibing wrote:
> > If parse_write_buffer_into_params() fails, we should free
> > wr_buf before return.
> >
> > Fixes: 6f77b2ac6280 ("drm/amd/display: Add connector HPD trigger debugfs entry")
> > Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>
> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
>
> Harry
>
> > ---
> > drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
> > index 83da24aced45..11e16fbe484d 100644
> > --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
> > +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
> > @@ -1089,8 +1089,10 @@ static ssize_t dp_trigger_hotplug(struct file *f, const char __user *buf,
> > if (parse_write_buffer_into_params(wr_buf, wr_buf_size,
> > (long *)param, buf,
> > max_param_num,
> > - ¶m_nums))
> > + ¶m_nums)) {
> > + kfree(wr_buf);
> > return -EINVAL;
> > + }
> >
> > if (param_nums <= 0) {
> > DRM_DEBUG_DRIVER("user data not be read\n");
> >
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-09-15 19:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-10 3:26 [PATCH -next] drm/amd/display: Fix possible memleak in dp_trigger_hotplug() YueHaibing
2020-09-10 15:34 ` Harry Wentland
2020-09-15 19:44 ` Alex Deucher
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®