[PATCH v2 0/2] NFS: Fix exception handling in nfs_alloc_server()

From: Markus Elfring

Date: Sun Jun 14 2026 - 04:43:35 EST


From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
Date: Sun, 14 Jun 2026 10:28:05 +0200
Subject: [PATCH v2 0/2] NFS: Fix exception handling in nfs_alloc_server()

A few update suggestions were taken into account from source code analysis.

Markus Elfring (2):
Prevent resource leak
Use common error handling code


v2:
Christophe Jaillet pointed out that ida_free() should be called in
the error handling path after a successful ida_alloc() call.
Thus corresponding tags were added.

See also:
https://elixir.bootlin.com/linux/v7.1-rc7/source/lib/idr.c#L549-L595


fs/nfs/client.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)

--
2.54.0