drm: Don't leak fb when plane crtc coodinates are bad
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 15 Oct 2015 17:39:58 +0000 (20:39 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 19 Oct 2015 09:00:45 +0000 (11:00 +0200)
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/drm_crtc.c

index 6058f4b141fe52cfbedbebf8c97d9b94d4191a89..ad7b7a762018104c384c898419074fb6d577f4eb 100644 (file)
@@ -2341,7 +2341,8 @@ static int __setplane_internal(struct drm_plane *plane,
            crtc_y > INT_MAX - (int32_t) crtc_h) {
                DRM_DEBUG_KMS("Invalid CRTC coordinates %ux%u+%d+%d\n",
                              crtc_w, crtc_h, crtc_x, crtc_y);
-               return -ERANGE;
+               ret = -ERANGE;
+               goto out;
        }