From patchwork Wed Jul 31 19:12:51 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: 13749086 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 8A554C3DA64 for ; Wed, 31 Jul 2024 19:17:04 +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=s4rNlRuFkM8gGELDONi+NdyqK2f0mOgXmseIth3ANj4=; b=Gp2aNpgSfcwijlTmru41lS1etM VYSQA7M/sPRdBw4vKu06aifrfU6Qa3ux5S03jyb9NR77jozj8WjXSZxh7y9zdLc6juBpo1IgLVaZO FNXeb2svshEF++nS3Zp/CE9glgWfse154lpQJYhhsRVrs6wWNkqSf2r4JlGf5ideYHWy4leMZ3Esa +rUCotLBaKRu/Xq+U8eOPZNeoud9TV6PKd6PgaSbM2KFP1k/zbhMQ7cq2jss8Q6IMZKEZvd1s7xdz 0Z1TuxKA6ebx8MwyUvrSD312jqGH6zEahKWuMzusdi4UFkr7Vjl3zuj39JAA21vf77Mzv7fxx6Cfd woNhBsvA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZEod-00000002F22-2WxU; Wed, 31 Jul 2024 19:16:51 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sZElq-00000002Dzj-2mVg for linux-arm-kernel@lists.infradead.org; Wed, 31 Jul 2024 19:13:59 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 1603D62579; Wed, 31 Jul 2024 19:13:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8BDF7C116B1; Wed, 31 Jul 2024 19:13:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722453237; bh=B57o1SV3zRToqiSMqD2BRI2alnivLDeH2CgGFuQHidc=; h=From:To:Cc:Subject:Date:From; b=poI2Or9pnWnOvRjcRnO3MXsmCJ/rM3NeJ5kvGl7KK++OXFPKMMeJV/K7WyN1SSn2q iW/jGdbMdLhczNJDA0Ef1KZYyfyYsmAB+wdxcJfGK4i7U89wuuV71Fdv86R+hHRexB o5UyGNEkQ9H9CMNWhfCh0TtpUve91tTQUt8h/+ajAZfMDvQvpRbmOzDVxR1Wp8vgtm 4XfdhtbWLREX2Dq97dwqLiR8Qx+tvBqotYxbP2rm/LvQRSUAd/YMSo32Eyf2sTPSoM EJi+yRk6RnMVPLxc/Z9Tt1PbWo146B1R2sRnydJrLphgTdLCD61dXOJcsTBgXEwTS+ XEuG/UwBPXIIg== From: "Rob Herring (Arm)" To: Jean Delvare , Guenter Roeck , Liviu Dudau , Sudeep Holla , Lorenzo Pieralisi Cc: linux-hwmon@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] hwmon: vexpress: Use of_property_present() Date: Wed, 31 Jul 2024 13:12:51 -0600 Message-ID: <20240731191312.1710417-13-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_121358_772020_2863D639 X-CRM114-Status: GOOD ( 11.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) Reviewed-by: Sudeep Holla --- drivers/hwmon/vexpress-hwmon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwmon/vexpress-hwmon.c b/drivers/hwmon/vexpress-hwmon.c index d82a3b454d0e..a2e350f52a9e 100644 --- a/drivers/hwmon/vexpress-hwmon.c +++ b/drivers/hwmon/vexpress-hwmon.c @@ -72,7 +72,7 @@ static umode_t vexpress_hwmon_attr_is_visible(struct kobject *kobj, struct device_attribute, attr); if (dev_attr->show == vexpress_hwmon_label_show && - !of_get_property(dev->of_node, "label", NULL)) + !of_property_present(dev->of_node, "label")) return 0; return attr->mode;