From patchwork Fri Aug 17 14:11:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans Verkuil X-Patchwork-Id: 10568855 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3240314BD for ; Fri, 17 Aug 2018 14:12:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 235FA2BB24 for ; Fri, 17 Aug 2018 14:12:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 177762BB26; Fri, 17 Aug 2018 14:12:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D59EB2BB24 for ; Fri, 17 Aug 2018 14:12:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A40856E65F; Fri, 17 Aug 2018 14:11:30 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from lb2-smtp-cloud8.xs4all.net (lb2-smtp-cloud8.xs4all.net [194.109.24.25]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5EDD36E643; Fri, 17 Aug 2018 14:11:27 +0000 (UTC) Received: from marune.fritz.box ([IPv6:2001:983:e9a7:1:45be:631a:bf72:a14]) by smtp-cloud8.xs4all.net with ESMTPA id qfTGfjkXWoj71qfTJfLsn1; Fri, 17 Aug 2018 16:11:25 +0200 From: Hans Verkuil To: linux-media@vger.kernel.org Subject: [PATCH (repost) 3/5] drm_dp_mst_topology: fix broken drm_dp_sideband_parse_remote_dpcd_read() Date: Fri, 17 Aug 2018 16:11:20 +0200 Message-Id: <20180817141122.9541-4-hverkuil@xs4all.nl> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180817141122.9541-1-hverkuil@xs4all.nl> References: <20180817141122.9541-1-hverkuil@xs4all.nl> X-CMAE-Envelope: MS4wfN7BKVtC3xUqyLeiDdyyBC81E3+GlilsTQ0a6iwKJcP9jgOy8G4XbgBLp6sL6crAE6jxR6XP3Sw+RsbNTKIfFs449D9Z3wNgQGB89ZT1tbDgJ+Z27RsY asAhjwrtvcrasDisR0d/pefDRHLYRExxOSKCFkPlBUKcIYK5/MIE3wB++RIp416H4YBQNRjw108zmPRXrdz0P4clm1/CFawZdzNVcwtcHIbcGk0RVnZ9h+Uq s5ns4WnVXeGnqILgiGLfrQ1NVl1Pq3hoGN3auWB/gE1aTzZ5XNz3Nh2ePB3mUzqUCRJ6pWgRY8TrETBJM2iUoI3DaqRSUGUJHLXRoBmLJP4YxjBANs1fe4+P ly7DQmojr1cTISwFSECIUyZuNrKi2g== X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nouveau@lists.freedesktop.org, Hans Verkuil , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Hans Verkuil When parsing the reply of a DP_REMOTE_DPCD_READ DPCD command the result is wrong due to a missing idx increment. This was never noticed since DP_REMOTE_DPCD_READ is currently not used, but if you enable it, then it is all wrong. Signed-off-by: Hans Verkuil Reviewed-by: Lyude Paul --- drivers/gpu/drm/drm_dp_mst_topology.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c index 7780567aa669..5ff1d79b86c4 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -439,6 +439,7 @@ static bool drm_dp_sideband_parse_remote_dpcd_read(struct drm_dp_sideband_msg_rx if (idx > raw->curlen) goto fail_len; repmsg->u.remote_dpcd_read_ack.num_bytes = raw->msg[idx]; + idx++; if (idx > raw->curlen) goto fail_len;