Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp616326pxx; Wed, 28 Oct 2020 12:29:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLPiSLsjYh9+wUAkq+YjC2ZgZkpIVSIRb+YAQ9mxL4aaDoa4cuLop6/Ekzv83rMf0b83W7 X-Received: by 2002:a17:906:31cb:: with SMTP id f11mr669033ejf.142.1603913378622; Wed, 28 Oct 2020 12:29:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603913378; cv=none; d=google.com; s=arc-20160816; b=ra18ZaRt+8IVNzHDIe2rDTeUnurwzukR22W8six4hFhaQ4oS6jCscS2gEgKupb8fI3 0b+C5e7KWdUbLfgQoeh2X5E6io4CbijEd4Anb7BhA0P1VvHuEFNWI8nuO7Y32TQMTnh1 EePTBfB/UEy2mb+ai6ZYUaR+X1E+0g7CfeLf7kvlsJloCI1XJ+NzSX/nt/S8+Fv6lYtB 9HfdzDJwehQGTyMP5G53oNyeTzEl8g6etpw9yyMDBLrnYd3+JfmnEHucMxG7Zd+HUszz jhCXVhuBtcoqcI5g1DXMMNYvTWafleV8sFarTvz2w7pRHWBrmkHTJYfSGpSjcTHHeGSH C20g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=lacNoHEyvM84PRsKyr6Mom9X1juXo0ReZDILf/mX7A8=; b=CdqwrlpKA0lJZohWL5BstCxPGeKZFPEn14CCJoEEk0USCmWd2YXmJa0afkfliw9SOA SCSRufOu1qqerHL1eg604BOrlDhWBuFUKx/xfKy9+X6J8DUs+OBrx89no1kZNISiFhPA X51G3OgajXK0CiJPh0KZtRoWXWawQ16DmWJdq9JEDL8/6gXKJ7aaHqp209PC4ZSCYRE6 Oc/Yjq3rkaulEIHKbPJHpASyczlqOE/JqarUa/KevK4Ax4aenUrTCkl0kno83Swrw0hW 3+xu1oTdKtcwrbK8w0Rp/abqGCoL3ZtRq01dUsypmv0O9ITNzVNv5kmZ0ckD5+IYTh4k bZ/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fRgs7Ken; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h13si2268edr.541.2020.10.28.12.29.16; Wed, 28 Oct 2020 12:29:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fRgs7Ken; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1827383AbgJ0SXa (ORCPT + 99 others); Tue, 27 Oct 2020 14:23:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:51146 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753926AbgJ0ODD (ORCPT ); Tue, 27 Oct 2020 10:03:03 -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 04CE52222C; Tue, 27 Oct 2020 14:03:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807382; bh=hhlNZSd18jXoaJsn/LJh8if3lsngdLGTRiTTCPpCh1I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fRgs7KenY2B18eP7gPZV0lfQWvQqkwVgdJb5We0OB4soliuYvsbJ3Aeui6tzXbL3B gzl0xpTtLGLUURzs5gF1WDpMnGdWyr6IsvhElXe9nQyaGGWZ8TMQznLgYFVukTOhve 7Ha8Ksh76c105NhgPPcRanvvnAKgnPqgB4oqZ5PM= 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.9 031/139] drm/gma500: fix error check Date: Tue, 27 Oct 2020 14:48:45 +0100 Message-Id: <20201027134903.613844852@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134902.130312227@linuxfoundation.org> References: <20201027134902.130312227@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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); -- 2.25.1