Article View: linux.kernel.netdev
Article #11262[PATCH RESEND v2 06/51] powerpc/pseries: put the node that the ofdt property commands look up
From: Christian Brauner
Date: Wed, 04 Nov 2026 19:17
Date: Wed, 04 Nov 2026 19:17
48 lines
11778 bytes
11778 bytes
parse_node() looks the node up with of_find_node_by_phandle(), which
returns it with a reference, and do_add_property(),
do_remove_property() and do_update_property() never put that
reference. Every property command written to /proc/powerpc/ofdt leaks
one. Put it when the command is done.
Fixes: 610d91511f99 ("[PATCH] powerpc: Add support for changing properties from userspace")
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
---
arch/powerpc/platforms/pseries/reconfig.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/reconfig.c b/arch/powerpc/platforms/pseries/reconfig.c
index 18e3f1a036e3..5a0c9c0b6253 100644
--- a/arch/powerpc/platforms/pseries/reconfig.c
+++ b/arch/powerpc/platforms/pseries/reconfig.c
@@ -271,8 +271,8 @@ static char *parse_node(char *buf, size_t bufsize, struct device_node **npp)
static int do_add_property(char *buf, size_t bufsize)
{
+ struct device_node *np __free(device_node) = NULL;
struct property *prop = NULL;
- struct device_node *np;
unsigned char *value;
char *name, *end;
int length;
@@ -296,7 +296,7 @@ static int do_add_property(char *buf, size_t bufsize)
static int do_remove_property(char *buf, size_t bufsize)
{
- struct device_node *np;
+ struct device_node *np __free(device_node) = NULL;
char *tmp;
buf = parse_node(buf, bufsize, &np);
@@ -315,7 +315,7 @@ static int do_remove_property(char *buf, size_t bufsize)
static int do_update_property(char *buf, size_t bufsize)
{
- struct device_node *np;
+ struct device_node *np __free(device_node) = NULL;
unsigned char *value;
char *name, *end, *next_prop;
int length;
--
2.53.0
Technical Details
Message-ID:
<20261104-work-procfs-bugfixes-v2-6-021c84d852e0@kernel.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-356729-linux-kernel-netdev=dewy.ruReferences:
<20261104-work-procfs-bugfixes-v2-0-021c84d852e0@kernel.org>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-356729-linux-kernel-netdev=dewy.ru From: brauner@kernel.org (Christian Brauner) Newsgroups: linux.kernel.netdev Subject: [PATCH RESEND v2 06/51] powerpc/pseries: put the node that the ofdt property commands look up Date: Wed, 4 Nov 2026 20:17:28 +0100 Organization: Usenet Network Message-ID: <20261104-work-procfs-bugfixes-v2-6-021c84d852e0@kernel.org> References: <20261104-work-procfs-bugfixes-v2-0-021c84d852e0@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="3487402"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:4/ELwmUi/DsAO1Bc4B8XDFp9sY0= sha256:n/Zf3q+V4MUQcwZ0fVejvtvmc7KzXDY+eBcfYUwlywc= sha1:cQW1SQJY7QaoSkbTUeWchr5rLeY= sha256:ZrcysnzyvXf8tY2Z/4/jCtAnK+DoMuJgD7mr7dDj5CI= List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 5F53F112D6E; Thu, 5 Nov 2026 00:07:21 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -2.301 X-Spam-Status: No, score=-2.301 tagged_above=-9999 required=6.31 tests=[DCC_CHECK=1.1, DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=kernel.org X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9zTSDobOmIbu; Thu, 5 Nov 2026 00:07:18 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-356729-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 34758112D3B; Thu, 5 Nov 2026 00:07:10 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id DFB96E2355; Wed, 4 Nov 2026 19:19:50 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1793819870; b=Fkp8TMXKPzPUuRk3BfnS25hJfsNsXH1uCGCI3/fNVd7/KyliU0Qnkej8pYt8RTF356/2 DfKaIN3fMshQusI/uajG4EaDl2NQlQkuyj/2b6LpAGh173EPsVWlLiQwqbd1aly2RD0dt fvomnkVhNzs79IA9j81hTxlGbn0hpaorTmkOU3WHDbuNeK4xrVU2XN8/ANpmmPHm+Trzg bvtA8+/aravq6BhpKrQKBLbVbOxJKMU3Mp87Ulnr2krHx34ElpWVROdLW469HmzCUgEm3 oSMzu8v+cMSI6aaAWnbSlNOkOHKf55bn+w8bFIFlP6vJGZL3XfS1xaaFXhRm/BLOykg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793819870; h=X-Original-To:Received:Received:DKIM-Signature:From:To:Cc:Subject: Date:Message-ID:In-Reply-To:References:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version:Content-Type:X-Mailer:X-Developer-Signature: X-Developer-Key:Content-Transfer-Encoding; bh=7dKsu59FtDy8aNyG4WRUkN7aPYhsNBybpSNJpPGyZ1Y=; b=O00qxp6af3oRU5NMQz5XUCc+kok1hTVXzZv/rBXkBr4KmTX9oycTAO0jYEHs2RHhF4cG sYRN93fIBFJDfrZMqmLl9YplwO9J08hm4B7qMmndmccTIBRqPwANueHYnkiSqBU/IFURc 2tzsuanjiPdVCjXlTiecuiA2RWM4I/wQZQWhovxrusF1Qa4HFLHmhddyzbBJ3nc4rv6+q x7dNNvo7NoxzLoLFcdzriFL1UtVIZJbFntgISvXFwaKTR03JJiihDptJPqkjKsJMDAsZi vt5Bf5Vms71amnB//noTRmQHQfCF3BPXpxqt2N4DEuAyeY9kHG6YW3efAvm+ogNKRhQ== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=I09Dgc3W; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 51430606D815; Wed, 4 Nov 2026 19:17:49 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=I09Dgc3W X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1793819863; b=FHkC2W2J8lj0k1NlUMn2qSOiZvB9PcxjW7uhIQkucxEN3BGyEUdG4pkIRDQG1JcnQnOe 8S5Q1srgkta3QNgxtBwkXavm1kcojdRdSRlp3BUD7D6kqOhAy7fpjW14wLp3xLfBpTgIo 6CGG4cXtxYWSo/CK+dR3yibi9pWlTTY62SMGDu0JK8/Cg30vfT9d7RwQjksvFMtFcIq0j dDKajssf7UaDPmouAI9u4gnydYXXLxgeTHIqDHXM8wxkZu9TM+lvsBVZi6Q3ZSt3CJYqQ AvvyaoCxnpy7B6P09ohAXeUuzXxJS3YcPKCdX3+p3AvREMyppXtvqIgOLfoob0w06zg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1793819863; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID: In-Reply-To:References:MIME-Version:Content-Type:X-Mailer: X-Developer-Signature:X-Developer-Key:Content-Transfer-Encoding; bh=7dKsu59FtDy8aNyG4WRUkN7aPYhsNBybpSNJpPGyZ1Y=; b=bBMhSArOp+yNGAbH779cUKVRahCZzdq7oDNNiNoioyvWuycTpcY8GLMRMCfN7Kh13c0G zQiCNuBU2ChbZf8CUmvDe46KzyOyfkiv8Swp2+3J/4P8i81c+g3ja9n4KAF965S/pO7S/ G2KxItTQbZvvdc0VNnz/PjlNd2JpUnZcNMp6gwK3yg62RwLaLHK3KOxHmQC1EttOHZ4JQ 2VRMWxqmOGTo7+Aqt4fh38IgBqwYgaRqzLpmtY3JDitPI9eZpQ6IUlCUeL1KfaiBjW1Pp lNNkdHfphJz6QLH6dtRLv+x0J/11flEj/KKBTMjY9c6YrO9pr5uB17Ewnqf34FnKwFw== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=I09Dgc3W; arc=none smtp.remote-ip=100.103.45.18 X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1948A606EE82; Wed, 4 Nov 2026 19:17:42 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id CEF121F00A02; Wed, 4 Nov 2026 19:17:30 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1793819862; bh=7dKsu59FtDy8aNyG4WRUkN7aPYhsNBybpSNJpPGyZ1Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=I09Dgc3WahkVUkdHZb1ultk0YMkOb02PK1qI6zEJbOi7/+V3zq8fq+cWRfZX05NQG 2lA2rqFRv/45g4bPULWMQHffdRExyDxzArc/hYgSBx4eO5MffKe3yy8p97CR46mmmZ 9dDXzJEWztjf6EaVEqFVKoidDZJ+7rTAReCBc9+dsxygtzA4VX74eEUMjD1bcfkFu3 QYaB8uEysRHzykLP06EUs/1ZqunIBWNogzs/SWlT+hZAEg08JSMeZHXTmY93feNFRf 2ZEizdSTdr3U+mIMp0z1pvTgsP0C80x+AxPAiukAaNUo0JSRGMr1Yf0WgHtW4okH6U zKMPB78QEQ4oA== X-Cc: Linus Torvalds <torvalds@linux-foundation.org>, Jann Horn <jannh@google.com>, Josef Bacik <josef@toxicpanda.com>, Chris Mason <mason@kernel.org>, Jeff Layton <jlayton@kernel.org>, NeilBrown <neil@brown.name>, Eric Dumazet <edumazet@kernel.org>, Thomas Gleixner <tglx@kernel.org>, Al Viro <viro@zeniv.linux.org.uk>, Jonathan Corbet <corbet@lwn.net>, Christoph Hellwig <hch@lst.de>, Greg Kroah-Hartman <gregkh@suse.de>, Joel Granados <joel.granados@kernel.org>, Kees Cook <kees@kernel.org>, Jan Kara <jack@suse.cz>, Jan Kara <jack@suse.com>, linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org, linux-um@lists.infradead.org, linux-wireless@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, netdev@vger.kernel.org, ntfs3@lists.linux.dev, platform-driver-x86@vger.kernel.org, coreteam@netfilter.org, kexec@lists.infradead.org, linux-pci@vger.kernel.org, linux-sound@vger.kernel.org, netfilter-devel@vger.kernel.org, dri-devel@lists.freedesktop.org, ibm-acpi-devel@lists.sourceforge.net, jfs-discussion@lists.sourceforge.net, linux-alpha@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-cifs@vger.kernel.org, linux-fbdev@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-mm@kvack.org, linux-sh@vger.kernel.org, linux-usb@vger.kernel.org, samba-technical@lists.samba.org, sparclinux@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-doc@vger.kernel.org, linux-serial@vger.kernel.org, linux-atm-general@lists.sourceforge.net, Takashi Iwai <tiwai@suse.de>, linux-input@vger.kernel.org, linux-raid@vger.kernel.org, linux-ext4@vger.kernel.org, linux-modules@vger.kernel.org, linux-debuggers@vger.kernel.org, "Christian Brauner (Amutable)" <brauner@kernel.org>, Chuck Lever <cel@kernel.org> X-In-Reply-To: <20261104-work-procfs-bugfixes-v2-0-021c84d852e0@kernel.org> X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-Mailer: b4 0.17-dev X-Developer-Signature: v=1; a=openpgp-sha256; l=1735; i=brauner@kernel.org; h=from:subject:message-id; bh=9GgvRCMv4/Dc1Z942cy3A7/ul6cTW5I084eAKnASIT8=; b=owGbwMvMwCU28Zj0gdSKO4sYT6slMWS9bry04VhwqY6ktsHfDTVnr+b4bPJgfc+0lt/P01dek tuWdbdCRykLgxgXg6yYIotDu0m43HKeis1GmRowc1iZQIYwcHEKwERavjAy7FnwPn/GgnMaE2ec 2t9e+OuRtkX+5sUTRSbzyRQ8OMAzexYjw5M736flveC7KnfK7e6vd6+v/AiwDEi4qz5l7VpJx5c MnYwA X-Developer-Key: i=brauner@kernel.org; a=openpgp; fpr=4880B8C9BD0E5106FC070F4F7B3C391EFEA93624