From patchwork Sun Jun 23 13:32:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ma Ke X-Patchwork-Id: 13709103 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F316AC2BD09 for ; Mon, 24 Jun 2024 07:23:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5B2FC10E382; Mon, 24 Jun 2024 07:23:00 +0000 (UTC) Received: from cstnet.cn (smtp84.cstnet.cn [159.226.251.84]) by gabe.freedesktop.org (Postfix) with ESMTPS id 27ADA10E106; Sun, 23 Jun 2024 13:33:11 +0000 (UTC) Received: from icess-ProLiant-DL380-Gen10.. (unknown [183.174.60.14]) by APP-05 (Coremail) with SMTP id zQCowAA3PQEGJHhmcC1VEg--.47951S2; Sun, 23 Jun 2024 21:33:06 +0800 (CST) From: Ma Ke To: harry.wentland@amd.com, sunpeng.li@amd.com, Rodrigo.Siqueira@amd.com, alexander.deucher@amd.com, christian.koenig@amd.com, Xinhui.Pan@amd.com, airlied@gmail.com, daniel@ffwll.ch, alvin.lee2@amd.com, wenjing.liu@amd.com, chaitanya.dhere@amd.com, hamza.mahfooz@amd.com, sohaib.nadeem@amd.com, samson.tam@amd.com, austin.zheng@amd.com, Qingqing.Zhuo@amd.com Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Ma Ke Subject: [PATCH] drm/amd/display: Add otg_master NULL check within init_pipe_slice_table_from_context Date: Sun, 23 Jun 2024 21:32:52 +0800 Message-Id: <20240623133252.2136231-1-make24@iscas.ac.cn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r0_Gr1lIxAIcVC2z280aVCY1x0267AKxVW8JVW8JrUvcS sGvfC2KfnxnUUI43ZEXa7VUby8BUUUUUU== X-Originating-IP: [183.174.60.14] X-CM-SenderInfo: ppdnvj2u6l2u1dvotugofq/ X-Mailman-Approved-At: Mon, 24 Jun 2024 07:22:58 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To avoid reports of NULL_RETURN warning, we should add otg_master NULL check. Signed-off-by: Ma Ke --- drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c b/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c index f6fe0a64beac..20f0951b00f1 100644 --- a/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +++ b/drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c @@ -1177,6 +1177,8 @@ static void init_pipe_slice_table_from_context( stream = context->streams[i]; otg_master = resource_get_otg_master_for_stream( &context->res_ctx, stream); + if (!otg_master) + continue; count = resource_get_odm_slice_count(otg_master); update_slice_table_for_stream(table, stream, count);