From: Dan Carpenter Date: Fri, 14 Apr 2017 19:54:25 +0000 (+0300) Subject: drm/i915: set "ret" correctly on error paths X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f4bf77b49516e12e89c7de89a343accd6cbe87f2;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git drm/i915: set "ret" correctly on error paths If "crtc" is NULL, then my static checker complains that "ret" isn't initialized on that path. It doesn't really cause a problem unless "ret" is somehow set to -EDEADLK which is not likely. Chris Wilson also noticed another error path where "ret" isn't set correctly. Signed-off-by: Dan Carpenter Link: http://patchwork.freedesktop.org/patch/msgid/20170414195425.GA8144@mwanda Reviewed-by: Chris Wilson Signed-off-by: Chris Wilson --- diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 48a546210d8b..85b9e2f521a0 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -9563,6 +9563,7 @@ int intel_get_load_detect_pipe(struct drm_connector *connector, */ if (!crtc) { DRM_DEBUG_KMS("no pipe available for load-detect\n"); + ret = -ENODEV; goto fail; } @@ -9619,6 +9620,7 @@ found: DRM_DEBUG_KMS("reusing fbdev for load-detection framebuffer\n"); if (IS_ERR(fb)) { DRM_DEBUG_KMS("failed to allocate framebuffer for load-detection\n"); + ret = PTR_ERR(fb); goto fail; }