Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp527469pxx; Wed, 28 Oct 2020 10:19:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxzEbhbpgwHBQYFEFzG6+1wStx5lcjrRG2j8EZ/V3KSUjcr94TeK2XlRu0nJQvN0PwdSwYW X-Received: by 2002:a17:906:1c57:: with SMTP id l23mr105175ejg.372.1603905595864; Wed, 28 Oct 2020 10:19:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603905595; cv=none; d=google.com; s=arc-20160816; b=vqxmqJT2GLewCfZufst0XQJWJDrOAcQ0FPapG2yVMW7oV7rm2KdS5AS+/SJ7A+vpwV kMTcH7V7TCe047rerE6RpZh01HwNak2Blg449Jx1I+j8CxZvkhq666oqmXxm8EbZy4qu 2Gat3Sne/rqbDpFTw2XAEdFn2SVuEfEUs7kCr8cJjr8p4nmggIQ6pyqVjUDHn8byHNwv QUKHHWU3FX7P77omBY9fd+RsbOqfhHi7+qGYoI/SEWVRNqsrzu8apAhEP+1SQR1/GZKC 7OxEcjpUcUG1C7P1H1tWcf0O21BKAmGDunPXZZqt4uhBdtuv5z/WCzbkOkyDBXabh++t Wdqw== 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=TJy0DRXetTK90WJPj2Kz9p31EabutPASyFNHE+o9i/I=; b=iIxICjQN56IwhDNV65nOtPps/pKrRJZwGYzpTYaAfGSiH385PitswnPYADnzkayr0k 5NI7LQlDI2PS8zwRytvpm68ezBEX0e1WXh2OD9KvN4Ctfi7gREsVKS2EUZKK9D6ODVgh CHA4LYYqV7uG0WJb4dm/GR7Wji+vdDqAeqQoLDA12tHQRtNxACbpUiwcO7Yxe2dlX3Z2 ZeRgrgqr+T+8XMIvWV8epcj+cXcQ4DBGxdpMNesMxG+AFIRhS1t59oeSZTdfBuaHGeOw fqiOgYZd09pNJmr9hMvkQFvpG8JAuXP51Y2CQHZlturL37av5+FthnICbHoQYmXQShIa M2eQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="cZR601s/"; 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 e13si3955588ejq.552.2020.10.28.10.19.33; Wed, 28 Oct 2020 10:19:55 -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="cZR601s/"; 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 S1820766AbgJ0RiH (ORCPT + 99 others); Tue, 27 Oct 2020 13:38:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:33812 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760553AbgJ0OfG (ORCPT ); Tue, 27 Oct 2020 10:35:06 -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 EB590207BB; Tue, 27 Oct 2020 14:35:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809301; bh=ecoBDCSGDdJ4lAPxADSnnNAvA1owgE4R6gdpbqHD6ZQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cZR601s/lo462tlMLj4WPLU1wWPzryXfPejje7qAd4vyF31Bt6hb9bePrWUQOPlJA jpl78Bi5qBVt8zhM6ylLC483Ymg5ePvClurKV6RmZB13N+/aZFTMz4orAQSstuL4pd xDxLN9uAJ2yzXFVFDLNkxTF+/nTd305lJMgMChH8= 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 5.4 117/408] drm/gma500: fix error check Date: Tue, 27 Oct 2020 14:50:55 +0100 Message-Id: <20201027135500.532172233@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@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 570b59520fd13..2ff4b35151bf8 100644 --- a/drivers/gpu/drm/gma500/cdv_intel_dp.c +++ b/drivers/gpu/drm/gma500/cdv_intel_dp.c @@ -2120,7 +2120,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