Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp746902pxb; Thu, 25 Feb 2021 14:11:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJwDz2fOX74gnk1wQ2ddEnA9wwMDMCintWhWFl/FNe33teCBFVxCASX2PJ3Mes2zKOUYaVsY X-Received: by 2002:a05:6402:3585:: with SMTP id y5mr93878edc.97.1614291065349; Thu, 25 Feb 2021 14:11:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614291065; cv=none; d=google.com; s=arc-20160816; b=pKkaAdot3c+AhOlPXJcMBo/eAXdJmz8Ca1+ilUwbVFpYzW+429k2VAlV/JlLFTmDe8 o3Bsbo2dybKzdLEauVrWkbRjAHTKcRHRtrK87Ckzgrqx83x7TDnlruDZvty5hOzq/XGd aw9FhHAT55WvfF0WgysxXHLPW6VsUv11ty1W55ngnVCfHg1DOca9GB9jLouJEXCt/0U0 Mi/lrcYpbmmnlQcauPaJVqSJtWIid4cY3CVCfOpHmwypYfjv0yj5gdONNizoR11Hn3In EFY8xs5Z3C8Oxlyh005X+wHipWZpOmhqaYO83YIV0rAnPQ10v8qWwERDvCBvilmYvq83 IzJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=gTvlqLNrtJ9ICfbf7sqeN9KjkYFwUR6wTEfk33ztBKU=; b=mLNd5EDsxp22LEEFyCNB5LvIBrUGDveVq+mIABiAFo0xjsxiBLRItwHlESN3nCcqt9 ulD7cvTeBgp2h8z0YdvsDVjdQuXm241zoxAx7bewceEZLEQ+6nshHcFkxi1DBGV8KbuL PJ2nOb0p17ucik9h5w/62uwb5TH9Fzk5GgOr46LBHXOLqBaeW5U4Q5Wf8GaV1HwQQa6X jAwybsPJ9VtZ0RxAP0I5c1IF8/jQxpiW0XBLiTlDc7QpWDpk5r/fO4sAs6+5Cp1bcDbz K/fV4yJeOX2I8NSdGZxFUieSNmeZJAe4LdXPOOXXAtH/gfalr2Unv2On91jElZ68MHAy qx6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZggjfsYN; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b14si4144952ede.90.2021.02.25.14.10.42; Thu, 25 Feb 2021 14:11:05 -0800 (PST) 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=k20201202 header.b=ZggjfsYN; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233578AbhBYWJX (ORCPT + 99 others); Thu, 25 Feb 2021 17:09:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:37880 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231326AbhBYWJV (ORCPT ); Thu, 25 Feb 2021 17:09:21 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2AD3164EC3 for ; Thu, 25 Feb 2021 22:08:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614290920; bh=lgsSKsv5WWGw6seu4nq2AHtd41HuWunf07o+L8YoEzI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ZggjfsYN5FrR9SupneuU2IRJjdzTdVaTsxv1Ie4wAMfYkcPd+2sXuu4YGSeIaV4nv 8/01nMunkI7RZIO4i803veSZ5IaPoiJndTcXU4x5+ANnUNfxgDqUYUKhbUsdQKhIdk GPgHbFuaNAnvOdTwF9w6UIEpudU/zxKsHFuQQ3oyEpDDUOaEjKgL6new7zEyVv/0h4 nsrowbXbCT3VeigwR5X56xc5bKhu4SjL6UvAN3PLtkvxs1/56GIcXJgXwOwOSvX487 wY7RcofYniaCfx6I9No7ymbnohUh12JsTNf3q9iayJoDFm8rJnPsUs65OjqYj1GbLj 96rt4hYCqdguQ== Received: by mail-ot1-f44.google.com with SMTP id s3so7262041otg.5 for ; Thu, 25 Feb 2021 14:08:40 -0800 (PST) X-Gm-Message-State: AOAM5333/aKlygN/jdk95NPHU3fQ4t0qP1dk688JukyUXoY0Ceyw1YZH 1LPyQtsEAB4ktpezdkxyNGqzkdrm5HDDxG9GcYI= X-Received: by 2002:a9d:6b8b:: with SMTP id b11mr4028035otq.210.1614290919292; Thu, 25 Feb 2021 14:08:39 -0800 (PST) MIME-Version: 1.0 References: <20210225150119.405469-1-arnd@kernel.org> In-Reply-To: From: Arnd Bergmann Date: Thu, 25 Feb 2021 23:08:23 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] drm/amd/display: Fix an uninitialized index variable To: Nick Desaulniers Cc: Harry Wentland , Leo Li , Alex Deucher , =?UTF-8?Q?Christian_K=C3=B6nig?= , Arnd Bergmann , David Airlie , Daniel Vetter , Nathan Chancellor , Nicholas Kazlauskas , Rodrigo Siqueira , Aurabindo Pillai , Stylon Wang , Eryk Brol , Bas Nieuwenhuizen , Bhawanpreet Lakha , Simon Ser , Qingqing Zhuo , amd-gfx list , dri-devel , LKML , clang-built-linux Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 25, 2021 at 10:34 PM 'Nick Desaulniers' via Clang Built Linux wrote: > return parse_edid_cea(aconnector, edid_ext, EDID_LENGTH, vsdb_info) ? i : -ENODEV; > > would suffice, but the patch is still fine as is. Right, I did not want to change more than necessary here, and the original code already had the extra assignment instead of returning the value. > > @@ -9857,8 +9857,8 @@ void amdgpu_dm_update_freesync_caps(struct drm_connector *connector, > > } > > } > > } else if (edid && amdgpu_dm_connector->dc_sink->sink_signal == SIGNAL_TYPE_HDMI_TYPE_A) { > > - hdmi_valid_vsdb_found = parse_hdmi_amd_vsdb(amdgpu_dm_connector, edid, &vsdb_info); > > - if (hdmi_valid_vsdb_found && vsdb_info.freesync_supported) { > > + i = parse_hdmi_amd_vsdb(amdgpu_dm_connector, edid, &vsdb_info); > > + if (i >= 0 && vsdb_info.freesync_supported) { > > reusing `i` here is safe, for now, but reuse of variables like this in > separate branches like this might not get noticed if the function is > amended in the future. > > > timing = &edid->detailed_timings[i]; > > data = &timing->data.other_data; The entire point of the patch is that 'i' is in fact used in the following line, but was lacking an intialization. Arnd