Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a8b0bbab authored by Jesper Juhl's avatar Jesper Juhl Committed by Daniel Vetter
Browse files

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: default avatarJesper Juhl <jj@chaosbits.net>
Reviewed-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent f4d71056
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
}