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")
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
if (parse_write_buffer_into_params(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");