From a07cf7f08d79924ba00fd702230d3e1690eebc5e Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Mon, 14 Nov 2016 14:31:34 +0900 Subject: [PATCH] libkms/exynos: fix memory leak in error path This patch fixes memory leak in error path of exynos_bo_create(). Signed-off-by: Seung-Woo Kim Reviewed-by: Emil Velikov Reviewed-by: Eric Engestrom --- libkms/exynos.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libkms/exynos.c b/libkms/exynos.c index 5de2e5a..0e97fb5 100644 --- a/libkms/exynos.c +++ b/libkms/exynos.c @@ -88,7 +88,8 @@ exynos_bo_create(struct kms_driver *kms, pitch = (pitch + 512 - 1) & ~(512 - 1); size = pitch * ((height + 4 - 1) & ~(4 - 1)); } else { - return -EINVAL; + ret = -EINVAL; + goto err_free; } memset(&arg, 0, sizeof(arg)); -- 2.7.4