From patchwork Tue Oct 27 13:48:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 306908 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 29647C55178 for ; Tue, 27 Oct 2020 18:16:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CE5C721556 for ; Tue, 27 Oct 2020 18:16:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603822601; bh=hhlNZSd18jXoaJsn/LJh8if3lsngdLGTRiTTCPpCh1I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=mvixSJ7Iwjl4hWqx5bhcM976JL3Lo05+swjgihn1fM1AS506eTW96mn+ErEf0iD6I SPOG3rz+b2yf9gXCN4HM9BD32lhwh3Zofp9vs01mTnmgtPnkNMlke3/WdW9klC0n1b 1RKwVJpgRtrHK754arcVjUevoQcF1xbTbXkuBPF0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756201AbgJ0OL6 (ORCPT ); Tue, 27 Oct 2020 10:11:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:59216 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755487AbgJ0OKL (ORCPT ); Tue, 27 Oct 2020 10:10:11 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5834A2072D; Tue, 27 Oct 2020 14:10:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807810; bh=hhlNZSd18jXoaJsn/LJh8if3lsngdLGTRiTTCPpCh1I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GD9yQhVrKgfoWp7Vj9dMIswpjh8UNmx5WGQyroNUoBUJSTxvs2yQHbaWHq6hdBvge TgFkVciVMRTb0HTwHCLV/nGHsiRITv8eUQa1KkZZ/14iiQmDtcd3qElVVrxKTr2/c0 5w7UDjI2CgBSbZsLfi36Pz8nO1bsiOg/PPmHps2k= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tom Rix , Patrik Jakobsson , Sasha Levin Subject: [PATCH 4.14 050/191] drm/gma500: fix error check Date: Tue, 27 Oct 2020 14:48:25 +0100 Message-Id: <20201027134912.140686794@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134909.701581493@linuxfoundation.org> References: <20201027134909.701581493@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Tom Rix [ Upstream commit cdd296cdae1af2d27dae3fcfbdf12c5252ab78cf ] Reviewing this block of code in cdv_intel_dp_init() ret = cdv_intel_dp_aux_native_read(gma_encoder, DP_DPCD_REV, ... cdv_intel_edp_panel_vdd_off(gma_encoder); if (ret == 0) { /* if this fails, presume the device is a ghost */ DRM_INFO("failed to retrieve link info, disabling eDP\n"); drm_encoder_cleanup(encoder); cdv_intel_dp_destroy(connector); goto err_priv; } else { The (ret == 0) is not strict enough. cdv_intel_dp_aux_native_read() returns > 0 on success otherwise it is failure. So change to <= Fixes: d112a8163f83 ("gma500/cdv: Add eDP support") Signed-off-by: Tom Rix Signed-off-by: Patrik Jakobsson Link: https://patchwork.freedesktop.org/patch/msgid/20200805205911.20927-1-trix@redhat.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/gma500/cdv_intel_dp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/gma500/cdv_intel_dp.c b/drivers/gpu/drm/gma500/cdv_intel_dp.c index c52f9adf5e04c..7ec4e3fbafd8c 100644 --- a/drivers/gpu/drm/gma500/cdv_intel_dp.c +++ b/drivers/gpu/drm/gma500/cdv_intel_dp.c @@ -2121,7 +2121,7 @@ cdv_intel_dp_init(struct drm_device *dev, struct psb_intel_mode_device *mode_dev intel_dp->dpcd, sizeof(intel_dp->dpcd)); cdv_intel_edp_panel_vdd_off(gma_encoder); - if (ret == 0) { + if (ret <= 0) { /* if this fails, presume the device is a ghost */ DRM_INFO("failed to retrieve link info, disabling eDP\n"); cdv_intel_dp_encoder_destroy(encoder);