Linux CIFS filesystem development
 help / color / mirror / Atom feed
* [PATCH] smb: client: Use common code in smb3_enum_snapshots()
@ 2025-10-08 20:40 Markus Elfring
  0 siblings, 0 replies; only message in thread
From: Markus Elfring @ 2025-10-08 20:40 UTC (permalink / raw)
  To: linux-cifs, samba-technical, Bharath SM, Paulo Alcantara,
	Ronnie Sahlberg, Shyam Prasad N, Steve French, Tom Talpey
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 8 Oct 2025 22:35:48 +0200

Use an additional label so that a bit of common code can be better reused
at the end of this function implementation.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 fs/smb/client/smb2ops.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c
index 7c3e96260fd4..6ca3046443c1 100644
--- a/fs/smb/client/smb2ops.c
+++ b/fs/smb/client/smb2ops.c
@@ -2301,8 +2301,7 @@ smb3_enum_snapshots(const unsigned int xid, struct cifs_tcon *tcon,
 		if (copy_from_user(&snapshot_in, ioc_buf,
 		    sizeof(struct smb_snapshot_array))) {
 			rc = -EFAULT;
-			kfree(retbuf);
-			return rc;
+			goto free_buf;
 		}
 
 		/*
@@ -2329,7 +2328,7 @@ smb3_enum_snapshots(const unsigned int xid, struct cifs_tcon *tcon,
 		if (copy_to_user(ioc_buf, retbuf, ret_data_len))
 			rc = -EFAULT;
 	}
-
+free_buf:
 	kfree(retbuf);
 	return rc;
 }
-- 
2.51.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2025-10-08 20:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-08 20:40 [PATCH] smb: client: Use common code in smb3_enum_snapshots() Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox