From: Markus Elfring <Markus.Elfring@web.de>
To: linux-nfs@vger.kernel.org, Anna Schumaker <anna@kernel.org>,
Benjamin Coddington <bcodding@redhat.com>,
Christophe Jaillet <christophe.jaillet@wanadoo.fr>,
Trond Myklebust <trondmy@kernel.org>
Cc: kernel-janitors@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>,
Christian Brauner <brauner@kernel.org>,
Christoph Hellwig <hch@lst.de>,
Chuck Lever <chuck.lever@oracle.com>
Subject: [PATCH v2 1/2] NFS: Prevent resource leak in nfs_alloc_server()
Date: Sun, 14 Jun 2026 10:42:18 +0200 [thread overview]
Message-ID: <9957a128-2c58-4d0c-967d-9f93ef970e1e@web.de> (raw)
In-Reply-To: <4f7c0c98-62b6-44e0-87b4-35abc46303de@web.de>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 14 Jun 2026 09:56:35 +0200
It was overlooked to call ida_free() after a failed nfs_alloc_iostats() call.
Thus add the missed function call in an if branch.
Fixes: 1c7251187dc067a6d460cf33ca67da9c1dd87807 ("NFS: add superblock sysfs entries")
Cc: stable@vger.kernel.org
Reported-by: Christophe Jaillet <christophe.jaillet@wanadoo.fr>
Closes: https://lore.kernel.org/linux-nfs/1c8e10c9-def7-4f0d-8aa1-23c8035a38c8@wanadoo.fr/
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
fs/nfs/client.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/nfs/client.c b/fs/nfs/client.c
index 73b95318ba48..e15568e388f8 100644
--- a/fs/nfs/client.c
+++ b/fs/nfs/client.c
@@ -1088,6 +1088,7 @@ struct nfs_server *nfs_alloc_server(void)
server->io_stats = nfs_alloc_iostats();
if (!server->io_stats) {
+ ida_free(&s_sysfs_ids, server->s_sysfs_id);
kfree(server);
return NULL;
}
--
2.54.0
next prev parent reply other threads:[~2026-06-14 8:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-10 16:35 [PATCH] NFS: Use common error handling code " Markus Elfring
2026-06-13 20:24 ` Christophe JAILLET
2026-06-14 8:37 ` [PATCH v2 0/2] NFS: Fix exception handling " Markus Elfring
2026-06-14 8:42 ` Markus Elfring [this message]
2026-06-14 8:43 ` [PATCH v2 2/2] NFS: Use common error handling code " Markus Elfring
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9957a128-2c58-4d0c-967d-9f93ef970e1e@web.de \
--to=markus.elfring@web.de \
--cc=anna@kernel.org \
--cc=bcodding@redhat.com \
--cc=brauner@kernel.org \
--cc=christophe.jaillet@wanadoo.fr \
--cc=chuck.lever@oracle.com \
--cc=hch@lst.de \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=trondmy@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®