[Intel-gfx] [PATCH] drm/i915: Fix error handling for the NV12 fb dimensions check

Ville Syrjala ville.syrjala at linux.intel.com
Mon Oct 29 14:00:31 UTC 2018


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

Let's not leak obj->framebuffer_references when we decide that
the framebuffer domensions are not suitable for NV12.

Cc: stable at vger.kernel.org
Cc: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
Cc: Vidya Srinivas <vidya.srinivas at intel.com>
Fixes: e44134f2673c ("drm/i915: Add NV12 support to intel_framebuffer_init")
Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index fe045abb6472..9b549d3dd055 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -14540,7 +14540,7 @@ static int intel_framebuffer_init(struct intel_framebuffer *intel_fb,
 	     fb->height < SKL_MIN_YUV_420_SRC_H ||
 	     (fb->width % 4) != 0 || (fb->height % 4) != 0)) {
 		DRM_DEBUG_KMS("src dimensions not correct for NV12\n");
-		return -EINVAL;
+		goto err;
 	}
 
 	for (i = 0; i < fb->format->num_planes; i++) {
-- 
2.18.1



More information about the Intel-gfx mailing list