From patchwork Wed Jul 31 19:12:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Rob Herring (Arm)" X-Patchwork-Id: 13749098 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 AFE28C3DA64 for ; Wed, 31 Jul 2024 19:18:26 +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: MIME-Version:Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=wrilM9hTznnXW8VuXJueA1EeQqSXhcWPCJVNnfqKJTA=; b=mGA9ClhXTYZSrU4Jgm7MF5KQ/H mKtcrSxJiHWb5VWi2VV7I/fQ9tB+OE9eLVwkPrOBKKYctl3rwxO13BDTLq/WlYONNiQNyRl5sdXvJ WruB8XD1si0Cx8OTB6ORTxBtS06Qu9mH/8fOOvg0sC9AJf8U82mfqYYIOt8D7kP3vgXElGN6grKFw rY4ph7Rwv4n47ejiOJlK1dzf0dR3rrNDK++qA66m0rB4QF0skLYxehAHJE0sm5+0CQWBMmU6bwY83 MttUcgu1IaEulLgXTZ+gc1RbiE6KIINVHJIebo/EdZ2r6KZ9ytKEYkJkRX8KqZCR+4WX2W3Kwvote NNNQFTrw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZEq1-00000002FX0-3qBC; Wed, 31 Jul 2024 19:18:17 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZEm2-00000002E4G-1gwy for linux-arm-kernel@lists.infradead.org; Wed, 31 Jul 2024 19:14:11 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id BE8DECE17DF; Wed, 31 Jul 2024 19:14:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AB01EC116B1; Wed, 31 Jul 2024 19:14:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722453248; bh=FZnEeld0Lth4UK91GvRatrGqtdswn6yWY0BBRWmhQps=; h=From:To:Cc:Subject:Date:From; b=P6BtyNQZD1Oa70wh5KRZjYDxUITJ40xp/xoL0dpLHa/tccxjP2hvTOJdA/jTzG6fN DhGdbEyeXFJUodGpse3h5Zl2oE1ao9fGaDEoCiGJfTPoUe/Zl7BSfNplvKASxiSk81 DXEjqInWnmkRKHt2Pg8aAjI/J6iHy7sk6ApC2kxr1IP8YqO47PIgykWHKs/w2Cxk9H zY6fkmKvZ2KoP8waeyxrLTeF61sGeSpNY4qTCxpaww8pMCRaaY1XgUmU/cAUDNVmUw 1Sl6ZvEkn2oZW0Sq/t+dYrzy23YE/7jGVF5bYtR2vMpAY1ugvBDAgNS/RtMEhBbzNE beSL2PViZYa9Q== From: "Rob Herring (Arm)" To: Peter Chen , Greg Kroah-Hartman , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam Cc: linux-usb@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] usb: chipidea: Use of_property_present() Date: Wed, 31 Jul 2024 13:12:56 -0600 Message-ID: <20240731191312.1710417-18-robh@kernel.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240731_121410_641880_312451B9 X-CRM114-Status: GOOD ( 12.15 ) 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 Use of_property_present() to test for property presence rather than of_get_property(). This is part of a larger effort to remove callers of of_get_property() and similar functions. of_get_property() leaks the DT property data pointer which is a problem for dynamically allocated nodes which may be freed. Signed-off-by: Rob Herring (Arm) Acked-by: Peter Chen --- drivers/usb/chipidea/ci_hdrc_imx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c index bdc04ce919f7..c64ab0e07ea0 100644 --- a/drivers/usb/chipidea/ci_hdrc_imx.c +++ b/drivers/usb/chipidea/ci_hdrc_imx.c @@ -128,7 +128,7 @@ static struct imx_usbmisc_data *usbmisc_get_init_data(struct device *dev) * In case the fsl,usbmisc property is not present this device doesn't * need usbmisc. Return NULL (which is no error here) */ - if (!of_get_property(np, "fsl,usbmisc", NULL)) + if (!of_property_present(np, "fsl,usbmisc")) return NULL; data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);