diff options
| author | Markus Elfring <elfring@users.sourceforge.net> | 2026-06-14 09:56:35 +0200 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2026-07-04 13:44:21 +0200 |
| commit | 62c26720121bfcb565f136d99bc40a7378a66fa0 (patch) | |
| tree | e0c8abb5eb0284b670a8e454fd9012312f433582 | |
| parent | 6919eb549e8f3caaef16d918749bf2b68d18532d (diff) | |
| download | linux-stable-62c26720121bfcb565f136d99bc40a7378a66fa0.tar.gz linux-stable-62c26720121bfcb565f136d99bc40a7378a66fa0.zip | |
NFS: Prevent resource leak in nfs_alloc_server()
commit d189f224308c8ac3feeea8e442c99922bd18f1b2 upstream.
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>
Signed-off-by: Anna Schumaker <anna.schumaker@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
| -rw-r--r-- | fs/nfs/client.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c index 2aaea9c98c2c..404e75b0444d 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c @@ -1070,6 +1070,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; } |
