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

Commit f4bf77b4 authored by Dan Carpenter's avatar Dan Carpenter Committed by Chris Wilson
Browse files

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170414195425.GA8144@mwanda


Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
parent be02f755
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -9563,6 +9563,7 @@ int intel_get_load_detect_pipe(struct drm_connector *connector,
	 */
	 */
	if (!crtc) {
	if (!crtc) {
		DRM_DEBUG_KMS("no pipe available for load-detect\n");
		DRM_DEBUG_KMS("no pipe available for load-detect\n");
		ret = -ENODEV;
		goto fail;
		goto fail;
	}
	}


@@ -9619,6 +9620,7 @@ int intel_get_load_detect_pipe(struct drm_connector *connector,
		DRM_DEBUG_KMS("reusing fbdev for load-detection framebuffer\n");
		DRM_DEBUG_KMS("reusing fbdev for load-detection framebuffer\n");
	if (IS_ERR(fb)) {
	if (IS_ERR(fb)) {
		DRM_DEBUG_KMS("failed to allocate framebuffer for load-detection\n");
		DRM_DEBUG_KMS("failed to allocate framebuffer for load-detection\n");
		ret = PTR_ERR(fb);
		goto fail;
		goto fail;
	}
	}