From patchwork Tue Sep 17 15:00:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Markus Elfring X-Patchwork-Id: 13806240 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 D7BC1CAC585 for ; Tue, 17 Sep 2024 15:02:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:Subject:From:Cc:To:MIME-Version:Date:Message-ID:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=4/S2yC/kdYw42oxDARzjfzTaoEFcZAO+vlfQhsMk6Ms=; b=o0oMkA1Q9UvUVFhN5tND+O/eE7 HYuRe4wcXcaIfetAjQS8AAHT7Nic3HLMBh8gxx+Uz/yx6DI7PKWYpk2lePTM8+zfLjXGPohmwzPaR /1QTyT97h1s8YvCF/NHIv9TvCFo1J6nyCsscVB+sp5EgeRRUGXYbJu7lEFK7iIR6qWESo34VHO3RF M2oViH77UsoSdjEjvh2QfX8BQcoLVoT1RJo8xnArPXFRvsaOrJ1Aaan9eA8HFzkH9kdBNlfTrjO7U 2Dmqj8fEJYGCohc5m/sfBrsmuRM3d/wbLQxNuwpDOdtkTiQcJtu3Lb1okbS5OIm3BYGIcgj885gjN UsHW8VXQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sqZiY-00000006M2z-4BJs; Tue, 17 Sep 2024 15:02:15 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sqZhU-00000006M06-1oOe for linux-arm-kernel@bombadil.infradead.org; Tue, 17 Sep 2024 15:01:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=Content-Transfer-Encoding:Content-Type :Subject:From:Cc:To:MIME-Version:Date:Message-ID:Sender:Reply-To:Content-ID: Content-Description:In-Reply-To:References; bh=4/S2yC/kdYw42oxDARzjfzTaoEFcZAO+vlfQhsMk6Ms=; b=aQItA6vG1uxePYrUTJ+lTVDDZG q056+Hkzdbwm18sIGOX+W+L2Q6Y4QM2QOZBa/Z4XESbve46KCBeHEeXlU2lhldrs45OqW7jZz+Z9q lBic/tN1p5AYdhDM1xRQNSuc0CylzyOGXb+vyRP3NL/vNtm+afCWbUqkKUgPWitdQV6lLi50IqiCw 9rfgP4Vw93IYNvw634nPHkJpdngcgfaNrdN3SAhfm2klyhSVxhEQQAAQOQi73N20MKlxA+1xMgwkU nDC1LxvdSjUB7KZ6wK+vKQjaRbfEBQdclNU0ZKuvGdfBnSGf3ZXvMFAWRr5jvh2GdbAQnLKlziiuO eol1h81Q==; Received: from mout.web.de ([212.227.15.4]) by desiato.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sqZhP-00000000czQ-1jEo for linux-arm-kernel@lists.infradead.org; Tue, 17 Sep 2024 15:01:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1726585238; x=1727190038; i=markus.elfring@web.de; bh=4/S2yC/kdYw42oxDARzjfzTaoEFcZAO+vlfQhsMk6Ms=; h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:To:Cc:From: Subject:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=ri7YYUgqsDy/Pxbt7RfWiVeJblQPn9mM1RCtYofMTtReuTTIyVe//X7TQ+vtfUjC b6OM8CMwW5TteWquaDMi/nSNxpaN0ixacL0bNAcEgqs+Wek2lSWYjVbvZ61mSaBjI wsAZRDDwUbiRWcdO09W9xrwLuNJtMCQ8iXYFPkEfoAKrP3P/PgrZQj2a7D2TE1bj0 Q9mBH4MZi2BbKDy0OHLwMlgavOyYnedI79/8xYVzvVwwrOMPJSSw32KtgrHur+LUN 9V69BXp+0ACRTWwOD90pEGu1nKYXENVyplONv6cjPtoLnE15U0PemPhJzMAo2BKUW w4pwclkRufl/3pNoGw== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.21] ([94.31.85.95]) by smtp.web.de (mrweb006 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MY5bV-1sTHYJ0hqv-00JLtP; Tue, 17 Sep 2024 17:00:38 +0200 Message-ID: <492f8027-f657-4def-b677-34d3f47d8de4@web.de> Date: Tue, 17 Sep 2024 17:00:31 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: imx@lists.linux.dev, dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, kernel@pengutronix.de, Andrzej Hajda , David Airlie , Fabio Estevam , Jernej Skrabec , Jonas Karlman , Laurent Pinchart , Liu Ying , Maarten Lankhorst , Maxime Ripard , Neil Armstrong , Robert Foss , Sascha Hauer , Shawn Guo , Simona Vetter , Thomas Zimmermann Content-Language: en-GB Cc: LKML From: Markus Elfring Subject: [PATCH] drm/bridge: imx: Use of_node_put(remote) call only once in imx8qxp_pc_bridge_probe() X-Provags-ID: V03:K1:JWmSeszK/KH8KKtj8pgGujoStJ/gM3R+Nmlpm1mQ+2BqBo8/aIB fRupnSYZy3H34rmR3qpou9g6WXH1i3DH0FG6zc5wmM3XB3HlHA67eTtIlA84zB2VVsMnPS2 wgW33mr7QxI7DVNaRQHJjJOxhSnxBuFee59Jmop/KFNAbzxU1Bvc2pcRVNlaE36JU/bHkXI SpmbFuvkRiFTLYQENAXJA== UI-OutboundReport: notjunk:1;M01:P0:s0vvRLopAFs=;j/jjZEvtcq7ivnsKI1xtfRQ5n49 Ff3rXD0idMx+PofLBerS296Jhk3ExBBEuEJxxPTpeXFXhgegVJyxfgHwCz8ahJhF07DdE0uiP 8/9oKZnAPkV+xsjMcbQgNfhHXkXm2g6JTh4vaewKuYvqtdbQ8XvjsdkDXmcVS6pAtBwSMK3on /FN4bOdkpiSEvjRbWy4GwaNemGTzH36I5l56fQ3KhfAXafrJBkcruAsXd7H3jJKmTu1FCliFt fuAJy6GJDS4cn77wsQ3menWHwJmYigkTSuNmOpPvVtatxW8QlN6au8ycO29VscGpRtDC5JKED IcjZL1G7MhpCS07f1qbTS0njZ4RPtjABNqJEKeIOhVXFRedMUfYzEovMKuRkGWBC+aQtk5j3m S4vdsPYgZaE9PNU+xstHBl5iuz7Q8IiAVv9okycDMgHtog52OkCmmQ6zMR01I60cxkvMvuMTJ EH8MwTENrOpKOxJVRhR327XHutF7aWDQvHt7CIw6ZoNmFq0mX5KV0eSWD3I8JnI1PRa4eRZD6 smDqs1HredAKgPNvxAiA0LFGFIaIkNXJAGqaJNwW2bl8QMxhamS5cUhNKoPG9q/9/QvUh5kJ9 pXzoDBDydrrA2eWHo/o1z80URAAoS98mYhpCasSpK9yx1kF162AUTiCKVbY/QIBvZONeN8Z10 5Xo5q14BUSAGBjuaaxicxLm+V0J0PJkbV7Tb6TFSeGf6AxPwFU1qsQQxhNPCAKERNpG2LDFGF ntvLWKtXhYOt4Gb2k87/PLeQvq+87lqQoSor0lTwK4ky2Y8UL4I6YcFc+a0+T21IweYhXHJWQ OTE8VKf3VWWqsHadvQPgJBfg== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240917_160103_690497_23C500BB X-CRM114-Status: UNSURE ( 8.43 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Markus Elfring Date: Tue, 17 Sep 2024 16:40:18 +0200 A of_node_put(remote) call was immediately used after a null pointer check for the data structure member “next_bridge” in this function implementation. Thus use such a function call only once instead directly before the check. This issue was transformed by using the Coccinelle software. Signed-off-by: Markus Elfring Reviewed-by: Liu Ying --- drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- 2.46.0 diff --git a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c index e6dbbdc87ce2..0064d37ad8f6 100644 --- a/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c +++ b/drivers/gpu/drm/bridge/imx/imx8qxp-pixel-combiner.c @@ -321,8 +321,8 @@ static int imx8qxp_pc_bridge_probe(struct platform_device *pdev) } ch->next_bridge = of_drm_find_bridge(remote); + of_node_put(remote); if (!ch->next_bridge) { - of_node_put(remote); ret = -EPROBE_DEFER; DRM_DEV_DEBUG_DRIVER(dev, "channel%u failed to find next bridge: %d\n", @@ -330,8 +330,6 @@ static int imx8qxp_pc_bridge_probe(struct platform_device *pdev) goto free_child; } - of_node_put(remote); - ch->bridge.driver_private = ch; ch->bridge.funcs = &imx8qxp_pc_bridge_funcs; ch->bridge.of_node = child;