mirror of
https://github.com/torvalds/linux.git
synced 2024-12-23 11:21:33 +00:00
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: Jesper Juhl <jj@chaosbits.net> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
parent
f4d7105648
commit
a8b0bbabf7
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user