From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D56E02F5E; Thu, 1 Aug 2024 00:17:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722471446; cv=none; b=NimJbEPjSETDCaChTOqB8lgGpc4zQNO2LQMEN8z9OykM9Kaq4CyfAX0HJiv5xuTw1KvYb/Iyd+JlEf5i1TmI+tBRvtyDPJz4yDxrKqrYGJ4foe4IIhgZaWLsBZ7fcVuQZYqg2zUfAFtqBqT9U1YFhnysCqWk9VxH2lzEjqDDQx4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722471446; c=relaxed/simple; bh=H8RbGKnc/apewFn075doefza/w+WhksTdezBBKO8wHk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tP871c9U9PMAe5BtrIvvDYIyDSYeeYpI5FrN/8Y7fakrB/IIowXVITx3zkW7Ia+tLSO1WN6Qn3sCaWg1yCq4oXylH4X0BlxqPJDYkk8Gj9sA6+Ad1QNoT9ZOsut+h+e0e0pwIXKgqzh/dIpIFmUzZflFv/WrFVjc+CiytGG35/I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=bmrhZARn; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="bmrhZARn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 182C2C32786; Thu, 1 Aug 2024 00:17:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722471446; bh=H8RbGKnc/apewFn075doefza/w+WhksTdezBBKO8wHk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bmrhZARnp7C+2aBZUpgU0FLZPxIuKvK6yCFLyZj0bRfzstW0GOO57BpyKfVMdLPPi ySOD2tbhOZAAP1oK6O0dGePtE32ZBmSX29IOcyO3oSBMz0TMeDygCTKZZoWi9S1HoK ugJQcHPQED4L55qDgUdi/RHCoKO7RaDcndmHGvYuZ2lgQ8EiqhKonEgAIth1QQ/zBA lf+pKSjlf/HLRP/zz2Wh2505eiYTAXXK9oo56P49yg69B9DhmVgGI4rkELYxLBuUW2 RgfcYUG2NDkub+CnAdtEsOrjxlKqykvHCyehlbayscg/XonSKSKBK/pZJA2IuJT/q6 Sbr9qle7onx/A== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Alex Hung , Rodrigo Siqueira , Daniel Wheeler , Alex Deucher , Sasha Levin , harry.wentland@amd.com, sunpeng.li@amd.com, Rodrigo.Siqueira@amd.com, christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch, hamza.mahfooz@amd.com, lewis.huang@amd.com, mghaddar@amd.com, srinivasan.shanmugam@amd.com, Bhawanpreet.Lakha@amd.com, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 6.10 098/121] drm/amd/display: Run DC_LOG_DC after checking link->link_enc Date: Wed, 31 Jul 2024 20:00:36 -0400 Message-ID: <20240801000834.3930818-98-sashal@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240801000834.3930818-1-sashal@kernel.org> References: <20240801000834.3930818-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.10.2 Content-Transfer-Encoding: 8bit From: Alex Hung [ Upstream commit 3a82f62b0d9d7687eac47603bb6cd14a50fa718b ] [WHAT] The DC_LOG_DC should be run after link->link_enc is checked, not before. This fixes 1 REVERSE_INULL issue reported by Coverity. Reviewed-by: Rodrigo Siqueira Signed-off-by: Alex Hung Tested-by: Daniel Wheeler Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/display/dc/link/link_factory.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/link/link_factory.c b/drivers/gpu/drm/amd/display/dc/link/link_factory.c index 2c3f5d6622851..c5486e6d89bd5 100644 --- a/drivers/gpu/drm/amd/display/dc/link/link_factory.c +++ b/drivers/gpu/drm/amd/display/dc/link/link_factory.c @@ -611,14 +611,14 @@ static bool construct_phy(struct dc_link *link, link->link_enc = link->dc->res_pool->funcs->link_enc_create(dc_ctx, &enc_init_data); - DC_LOG_DC("BIOS object table - DP_IS_USB_C: %d", link->link_enc->features.flags.bits.DP_IS_USB_C); - DC_LOG_DC("BIOS object table - IS_DP2_CAPABLE: %d", link->link_enc->features.flags.bits.IS_DP2_CAPABLE); - if (!link->link_enc) { DC_ERROR("Failed to create link encoder!\n"); goto link_enc_create_fail; } + DC_LOG_DC("BIOS object table - DP_IS_USB_C: %d", link->link_enc->features.flags.bits.DP_IS_USB_C); + DC_LOG_DC("BIOS object table - IS_DP2_CAPABLE: %d", link->link_enc->features.flags.bits.IS_DP2_CAPABLE); + /* Update link encoder tracking variables. These are used for the dynamic * assignment of link encoders to streams. */ -- 2.43.0