Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp956950pxb; Wed, 3 Mar 2021 22:28:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJwIKZpfF7dTLQC86KJwc2nx9eEkA78PIaHoSYZT/+fK+TnBwOQ/8kpR7bzBVopO41MJ1uzx X-Received: by 2002:a05:6402:3096:: with SMTP id de22mr2645135edb.141.1614839314771; Wed, 03 Mar 2021 22:28:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614839314; cv=none; d=google.com; s=arc-20160816; b=eXr2k4/k7Cu7ZOmlrSI8gbQsGwmJ90yQ1y8w5Pt8ZXC6AQMhq9Qs4sUDyhHCmzjOzE 6cqw1r3K5Zd/WoTbhcolIWtS4x4Qg8z7pIxiH6CUJSoESDXgLO29nXRaO+k/DusUw4Xx mHsCYJaPHfpz8qfVWcXOKaGomrAAP8CUn2GjIe2YwFoE9iliwPWCI5CD+nlgsgpYgtoS z6HaWZvtbdqUXARympqyCZ2EpD+3Tq97q6RH+0PmeEI9zKGGGZp+uyej/+LXD0ZuaQKl qL9JEeauRXZorkQ5cL80jj3uAc2gtcZBxmg217aaxBHwygJHsOpHiEV3HMMCokPl77KR m1sg== 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 :message-id:date:subject:cc:to:from; bh=aObrMAyR7yFaYZKhCjJIbtGdGu+2/KCWRbMDttJNCfc=; b=YfuUvbGH7xvAgToBQDIkQdfKxUkwTytmMIBtNmHt93LqhSAxIz3Hr/qTWDLXcXqlau eLgq1/kXtOayzRPOl6d3oIdmAMV4+HFp8d8HfJC4CfeVHcIXj0+6ZRhg5j2WHr4wiXfM 2YI1EdhbWJfcVYDPVy1H3RtWIHnR5DS8V4DYfupDHbGsyY3N+Aq8vZLxyCYKIgIfFXFU CAq0EkPgWT6qpSxpPMw5vJgFwXHv3ZdhipzrES98jgIb5jHon8BokQUlLQ3ArWUyHTYL 0fnsO4s1S25aGKW7GRhMzhowYTdKsFG11OJkE8pyKhIgqaeljfk/FfOnY5uCkR4o5Guk B7QQ== ARC-Authentication-Results: i=1; mx.google.com; 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=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rh9si10204141ejb.85.2021.03.03.22.28.12; Wed, 03 Mar 2021 22:28:34 -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; 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=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1579059AbhCBQ2E (ORCPT + 99 others); Tue, 2 Mar 2021 11:28:04 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:54872 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1572940AbhCBOIF (ORCPT ); Tue, 2 Mar 2021 09:08:05 -0500 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lH5e9-0005J7-TI; Tue, 02 Mar 2021 14:05:09 +0000 From: Colin King To: Harry Wentland , Leo Li , Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , David Airlie , Daniel Vetter , Anson Jacob , Mikita Lipski , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH][next] drm/amd/display: fix the return of the uninitialized value in ret Date: Tue, 2 Mar 2021 14:05:09 +0000 Message-Id: <20210302140509.8466-1-colin.king@canonical.com> X-Mailer: git-send-email 2.30.0 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: Colin Ian King Currently if stream->signal is neither SIGNAL_TYPE_DISPLAY_PORT_MST or SIGNAL_TYPE_DISPLAY_PORT then variable ret is uninitialized and this is checked for > 0 at the end of the function. Ret should be initialized, I believe setting it to zero is a correct default. Addresses-Coverity: ("Uninitialized scalar variable") Fixes: bd0c064c161c ("drm/amd/display: Add return code instead of boolean for future use") Signed-off-by: Colin Ian King --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c index 5159399f8239..5750818db8f6 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c @@ -530,7 +530,7 @@ bool dm_helpers_dp_write_dsc_enable( { uint8_t enable_dsc = enable ? 1 : 0; struct amdgpu_dm_connector *aconnector; - uint8_t ret; + uint8_t ret = 0; if (!stream) return false; -- 2.30.0