Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1113812imm; Wed, 1 Aug 2018 10:24:20 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdGWd7rZkc49IQl0JGxy7j3ff212XcV7NrVMIw39TPMc2pB75TTC8glUNXb1qnUJjjyRuVy X-Received: by 2002:a17:902:9687:: with SMTP id n7-v6mr24960167plp.33.1533144260553; Wed, 01 Aug 2018 10:24:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533144260; cv=none; d=google.com; s=arc-20160816; b=BCiJ9cy6Iw0y2u9bCcSb+mYRaaLH6ZQxt6EQs2ZSJkrmLSiZ21dmfwjhPO9z14q/dz ACkll+AbvlUsn5Wl0i/DHYyKQysqkO9DfFPXADZVO5Dynap15+krPf+Q5SpWHG0xdGG5 MscRQ/OXU5OF6XnNkWi1wydeGO5N9RXWmpHB6diDmT4ufyfIYB6ukZDue8HCIWGw/eFB El6pLs5owxK6L7JA2KvSYfNPVdiIJrl/dejy3vlUIrKR2hUhNMUOjbjAdlPLy5uig01G 1mItssjeLZXD8U5tdKP8D7e24qHJBAiEVAIiAwqXfsb1Q2vqFmkF+q6TLBWl76P3zf/v FjJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=1Ip7US9avyS+UbqZtyJPCoU70c/oAUTA9ZcmeY/LIZE=; b=L/FxL6x6NVXu4PkHuV3G4S1xtYI/xMPCSyR04z8DodcQbItshMOiJkqYQns52JWDnz EDe5BZxV4i5Bu6MYlIicpk0t6z2IEUv4myoSYM/Mym4G/a4eBG7MJXud+zoL0xaT2P5C bRh8V+JlHzyi5prQgB5yXFtYe/iXJ5RzGhMrjUaKx40qcOfO06D2DIfVSHuH4J7asS0D re5UHAlMl/61Ify4Z6U/S8jZqvh6+SLLum3vMlTnNb6O8oii5P9+tkm7v9KAIHcXQOqA qCdvYf384jtLqGbPWb60JBlgAD80DKB3EGn64WEbvkcmL/o//ByRBplfNBqoKmaJ9G8Z DIzQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n10-v6si17532895pfb.316.2018.08.01.10.24.05; Wed, 01 Aug 2018 10:24:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390348AbeHATJQ (ORCPT + 99 others); Wed, 1 Aug 2018 15:09:16 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:50732 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389759AbeHATJP (ORCPT ); Wed, 1 Aug 2018 15:09:15 -0400 Received: from localhost (D57E6652.static.ziggozakelijk.nl [213.126.102.82]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 71700D2F; Wed, 1 Aug 2018 17:22:33 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dave Airlie , Andy Shevchenko , Jani Nikula , Sasha Levin Subject: [PATCH 4.14 214/246] drm/dp/mst: Fix off-by-one typo when dump payload table Date: Wed, 1 Aug 2018 18:52:04 +0200 Message-Id: <20180801165021.950806129@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180801165011.700991984@linuxfoundation.org> References: <20180801165011.700991984@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Andy Shevchenko [ Upstream commit 7056a2bccc3b5afc51f9b35b30a46f0d9219968d ] It seems there is a classical off-by-one typo from the beginning when commit ad7f8a1f9ced ("drm/helper: add Displayport multi-stream helper (v0.6)") introduced a new helper. Fix a typo by introducing a macro constant. Cc: Dave Airlie Signed-off-by: Andy Shevchenko Signed-off-by: Jani Nikula Link: https://patchwork.freedesktop.org/patch/msgid/20180319141932.37290-1-andriy.shevchenko@linux.intel.com Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/drm_dp_mst_topology.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -2862,12 +2862,14 @@ static void drm_dp_mst_dump_mstb(struct } } +#define DP_PAYLOAD_TABLE_SIZE 64 + static bool dump_dp_payload_table(struct drm_dp_mst_topology_mgr *mgr, char *buf) { int i; - for (i = 0; i < 64; i += 16) { + for (i = 0; i < DP_PAYLOAD_TABLE_SIZE; i += 16) { if (drm_dp_dpcd_read(mgr->aux, DP_PAYLOAD_TABLE_UPDATE_STATUS + i, &buf[i], 16) != 16) @@ -2936,7 +2938,7 @@ void drm_dp_mst_dump_topology(struct seq mutex_lock(&mgr->lock); if (mgr->mst_primary) { - u8 buf[64]; + u8 buf[DP_PAYLOAD_TABLE_SIZE]; int ret; ret = drm_dp_dpcd_read(mgr->aux, DP_DPCD_REV, buf, DP_RECEIVER_CAP_SIZE); @@ -2954,8 +2956,7 @@ void drm_dp_mst_dump_topology(struct seq seq_printf(m, " revision: hw: %x.%x sw: %x.%x\n", buf[0x9] >> 4, buf[0x9] & 0xf, buf[0xa], buf[0xb]); if (dump_dp_payload_table(mgr, buf)) - seq_printf(m, "payload table: %*ph\n", 63, buf); - + seq_printf(m, "payload table: %*ph\n", DP_PAYLOAD_TABLE_SIZE, buf); } mutex_unlock(&mgr->lock);