提交 a8b0bbab 编写于 作者: J Jesper Juhl 提交者: Daniel Vetter

drm/i915/sprite: Fix mem leak in intel_plane_init()

If we ever hit the default case in the switch statement we'll return
from the function without freeing the memory we just allocated to
'intel_plane' (but that has not been used).

This patch gets rid of the leak by freeing the memory just before we
return.
Signed-off-by: NJesper Juhl <jj@chaosbits.net>
Reviewed-by: NJesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
上级 f4d71056
......@@ -691,6 +691,7 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe)
break;
default:
kfree(intel_plane);
return -ENODEV;
}
......@@ -705,4 +706,3 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe)
return ret;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册