smb: client: Use common code in smb3_enum_snapshots()
Subsystems (3)
PATCH 1/1 smb: client: Use common code in smb3_enum_snapshots()
From: Markus Elfring <[email protected]>
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 <[email protected]>
--- fs/smb/client/smb2ops.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
fs/smb/client/smb2ops.c +2 -3
@@ -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; }
Signature · 1 line
2.51.0