From mboxrd@z Thu Jan 1 00:00:00 1970 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 C6651C3DA4A for ; Fri, 9 Aug 2024 01:22:02 +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:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=+nLSrKApi69wlTa+5z3xjhO/eYpgxmG2rN84z4tYR7A=; b=BLFdbqA8IZagYHsG+oALxy9Z8L ViqbozrIG6BsLGsdqWk/crQw2KDuPnvW7Lvdy5dFmvfHuCpeRailAcWk8Ui+pf/iTtDW+KfRkRMxm jGbbPDUJ7nfsINel48CeGAr4THpkt1uq7q2E+uuWJVL8ntNoH6TkFTijheUht7ROJTF/6WBTgQJza iTp3PJzxXw3Zfsh24k4uMpDHvgOQkJSPP8yRASYkCPPTbBTUrYXYTq3UtyGJUCl121CRWMpsed6IX LcNAQOePpI2Bj1BEsDHkkgFfkm7pa6HV+6vNQSaf5vqfgaPqq/vPCelGzh4N5W3sOME1/DcNkG1ww oympzFtQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1scEKH-00000009uwK-1T7f; Fri, 09 Aug 2024 01:21:53 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1scEJi-00000009urL-0y5E for linux-arm-kernel@lists.infradead.org; Fri, 09 Aug 2024 01:21:19 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 5282861626; Fri, 9 Aug 2024 01:21:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33153C32782; Fri, 9 Aug 2024 01:21:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1723166477; bh=LCyBe1tA4zdG2wJLz9kV+ZRo3NmRqgcBAdqMq7ml4tU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Wd4cEORzJr17CaXC+6578qIZqPq7psqloTUI5ZGW9jUWp8qxGH4rddchWVoFj7eXJ YMTcVKup14nkRvtFgGmZg4xbD0s8wqpgOmGN/JKoncAisA4Q0yIEFxmlvNsrJfi8zF t1Z/fucCQlggn0UoWHFNqchkqLjLaMDhwIyaKZb+/2nMpsSVao0aWLlPDSR+YXLYKb AYhK+JT95/YO1mIV4O6UYnCv6Wu1Mk802NICgHI+hQfg0BViOEYw8kijkaKGBcYDps 0p7t3NZbkwUkKd50SEbs5lJu9yKknhvFz5lArHLHpMQRxISoUL3VaR5sdOi3KH7EEr zoAMqB5FVMz7A== Date: Fri, 9 Aug 2024 09:21:09 +0800 From: Peter Chen To: "Rob Herring (Arm)" Cc: Greg Kroah-Hartman , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , linux-usb@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb: chipidea: Use of_property_present() Message-ID: <20240809012109.GB2673490@nchen-desktop> References: <20240731191312.1710417-18-robh@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240731191312.1710417-18-robh@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240808_182118_359955_81C548A7 X-CRM114-Status: GOOD ( 18.57 ) 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 On 24-07-31 13:12:56, Rob Herring (Arm) wrote: > 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); > -- > 2.43.0 >