Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp181309pxx; Wed, 28 Oct 2020 01:53:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0NRJJZ67kyIJ7t7vpavleaVpsOblb9aOZJCaayR0Ng0HhANwBvXCoDteYeD8WgGbml5YI X-Received: by 2002:a05:6402:13cc:: with SMTP id a12mr6672340edx.73.1603875238876; Wed, 28 Oct 2020 01:53:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603875238; cv=none; d=google.com; s=arc-20160816; b=R+gANS9nntdrPP8JavVEFfXN74eWDrsPy5C8480FGVP0ppnqSOvCh8YtvE0WnVtICt uo641rEYjALXTwZvywvVTTG4iseTG561ZR9d0mIrETsbPRyMLqOGnSlVvQ/Sa/okcA+k J7bE5WVPW4O8TlQzjQJ+V8OvZNZOhjDPZgbjkjccm73td+beuwBVO7mtnwdlAMxkhmme KFjnIStEACbR72+N93T4XQZlAffIUj9t4cth/UbWrK6DOPo850oC1/S3uq+vWc/IrhCA RghMRljYnw/FQbM7RVs9HbUg34Ezb5AY+pF7RXPwfWcxzLg6yFSNxx7cJjfP/bdmqVWq RxFw== 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=Qm6jpq7hOPezVaUwQ0GqKMY8JPWbF8dMje5U3Z8qc8ug/aE9zSXw7/iAvJgs5xYiwH p+wZPtlwxAFhEksioCAyo5rbCVb1/ONGeJeIYmKUBZIcDD/RiIU/7O2oJso+HO+LI6xU JY0TqoVydiO3rlF0Kx9pM3NjWPjKm3/gnlHKsE01TWR2Ztp+YJnrCaI6/okZSnLYF9i7 isuWz/GmNQMPXfmaoszdNLZCt8B1nenIHmH6D2Lc2CEAx1DgTqRwZhdQ4Oem6WqEkdxs nyl6vqcZMnrkV/JPv4/hl2HTF8EPK+m7ufapcAAxWCmHDEisFHfsIvfBfjZuX6bWTiYv tWqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=GD9yQhVr; 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 b29si2827715edn.354.2020.10.28.01.53.36; Wed, 28 Oct 2020 01:53:58 -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=GD9yQhVr; 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 S1756505AbgJ0ONs (ORCPT + 99 others); Tue, 27 Oct 2020 10:13:48 -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 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