Commit d75fa679 authored by YueHaibing's avatar YueHaibing Committed by Alex Deucher

drm/amd/display: Fix possible memleak in dp_trigger_hotplug()

If parse_write_buffer_into_params() fails, we should free
wr_buf before return.

Fixes: 6f77b2ac ("drm/amd/display: Add connector HPD trigger debugfs entry")
Reviewed-by: default avatarHarry Wentland <harry.wentland@amd.com>
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent d56b83f7
...@@ -1093,8 +1093,10 @@ static ssize_t dp_trigger_hotplug(struct file *f, const char __user *buf, ...@@ -1093,8 +1093,10 @@ static ssize_t dp_trigger_hotplug(struct file *f, const char __user *buf,
if (parse_write_buffer_into_params(wr_buf, size, if (parse_write_buffer_into_params(wr_buf, size,
(long *)param, buf, (long *)param, buf,
max_param_num, max_param_num,
&param_nums)) &param_nums)) {
kfree(wr_buf);
return -EINVAL; return -EINVAL;
}
if (param_nums <= 0) { if (param_nums <= 0) {
DRM_DEBUG_DRIVER("user data not be read\n"); DRM_DEBUG_DRIVER("user data not be read\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment