提交 915a428e 编写于 作者: D Dan Carpenter 提交者: Eric Anholt

drm/i915: fix small leak on overlay error path

We should free "params" before returning.
Signed-off-by: NDan Carpenter <error27@gmail.com>
Reviewed-by: NDaniel Vetter <daniel@ffwll.ch>
Cc: stable@kernel.org (for .33)
Signed-off-by: NEric Anholt <eric@anholt.net>
上级 1f2b1013
......@@ -1068,14 +1068,18 @@ int intel_overlay_put_image(struct drm_device *dev, void *data,
drmmode_obj = drm_mode_object_find(dev, put_image_rec->crtc_id,
DRM_MODE_OBJECT_CRTC);
if (!drmmode_obj)
return -ENOENT;
if (!drmmode_obj) {
ret = -ENOENT;
goto out_free;
}
crtc = to_intel_crtc(obj_to_crtc(drmmode_obj));
new_bo = drm_gem_object_lookup(dev, file_priv,
put_image_rec->bo_handle);
if (!new_bo)
return -ENOENT;
if (!new_bo) {
ret = -ENOENT;
goto out_free;
}
mutex_lock(&dev->mode_config.mutex);
mutex_lock(&dev->struct_mutex);
......@@ -1165,6 +1169,7 @@ int intel_overlay_put_image(struct drm_device *dev, void *data,
mutex_unlock(&dev->struct_mutex);
mutex_unlock(&dev->mode_config.mutex);
drm_gem_object_unreference_unlocked(new_bo);
out_free:
kfree(params);
return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册