Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp162760pxx; Wed, 28 Oct 2020 01:12:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXvQeAUgPTMGkJNhw6WAcxGNWtaWwLj4KNLELID8z0KyMfBIpULA82EcLYQtCb33MahbuO X-Received: by 2002:a05:6402:6d8:: with SMTP id n24mr6563185edy.168.1603872757607; Wed, 28 Oct 2020 01:12:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603872757; cv=none; d=google.com; s=arc-20160816; b=HAyCm/WQYQzAedZMkLGeoy4WR7U4GlIuOGWNhVhOevipKHZGLc0ksKij+AQ8Ciig6x rzsNShG0jTYffTdbSUDinKc4hJi2GtrV9e1wFzEvW+dFkXMq17JVTWnL6ij6re5n/jRF 2CkhMYioyG6zJTY0vc1rbep++o3aO0yueaCz6mSiD7nLjB0jd4gGIL4BNcxM2z4QZVVF ZBSzW562IboGLtQgsKWg6XwlPLq9Tjy6O1b+onsb0bpTQwKap/waKI1+bPt3O8VuTd4f hrVDQfc1sAX8PMwd+55OKJGCTqylyksKUuUKpN5Vhq87MPVjB0yKrq1zdMxluwVyOGSP lSyg== 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=iyuPK6ra5ASIfemmkiU0Y00aXgYbY7LFiW2hc65VCIM=; b=ueKaiA5VSdfF+wQ5fdmWWmW+IybNTq+nX82UOg3q6RGzSIWPee0VlhstDEc0OM5jOr NlQACcZzxB2tLtKnSk+B6d1WOxW6C7IbVVJY3XaeEWBo2Kc3YdhYIJZzna8R/XVltuqD sxlzU4nPv4yK1Mbmp4J1QUKbBPU2qVvZv6QVw0badOSBAoCU/6KxmaDtS9M/Mg6mKv0R AeZWG/eePcZiBenb63uev3NGKlQF4v/xsu383eTLfiAYJQ0Zstk4sr6oyFDP1CK11skA 83Ds3atGbw98mKkvhesgtUh4iovvCUrrPV5a2GKdLzbX9TXGraY04Cu1YCqPD/n1tfbm U4ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=0OadojAQ; 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.12.15; Wed, 28 Oct 2020 01:12:37 -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=0OadojAQ; 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 S1753237AbgJ0N7R (ORCPT + 99 others); Tue, 27 Oct 2020 09:59:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:46658 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753222AbgJ0N7N (ORCPT ); Tue, 27 Oct 2020 09:59:13 -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 D6A1D2068D; Tue, 27 Oct 2020 13:59:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603807152; bh=uUsq9B0wpCBivWlFxqoUjq6XhILmMjvt1INfPDX/6cM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0OadojAQqkmPb84qnrC+30V/HIu+JEH+OtPlzdoEcxNjJHElg+5aUPCmPkhtPcoP1 OP50WaSFjiGS1u25PlvVxk0H4kQnPVcU3K2wEr6BHDJmMaljkkZ9edIa47Kqk2xo3q FR2+zxrRb6CDSEe/N9JeHEvG8WIs4J7fwv4d5wFE= 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.4 031/112] drm/gma500: fix error check Date: Tue, 27 Oct 2020 14:49:01 +0100 Message-Id: <20201027134902.035333527@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027134900.532249571@linuxfoundation.org> References: <20201027134900.532249571@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 d3de377dc857e..25c68e4dc7a53 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