[<prev] [next>] [day] [month] [year] [list]
Message-ID: <9bd9d534-d0a8-4058-a26e-622bf15b804c@web.de>
Date: Wed, 8 Oct 2025 22:40:52 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: linux-cifs@...r.kernel.org, samba-technical@...ts.samba.org,
Bharath SM <bharathsm@...rosoft.com>, Paulo Alcantara <pc@...guebit.org>,
Ronnie Sahlberg <ronniesahlberg@...il.com>,
Shyam Prasad N <sprasad@...rosoft.com>, Steve French <sfrench@...ba.org>,
Tom Talpey <tom@...pey.com>
Cc: LKML <linux-kernel@...r.kernel.org>, kernel-janitors@...r.kernel.org
Subject: [PATCH] smb: client: Use common code in smb3_enum_snapshots()
From: Markus Elfring <elfring@...rs.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@...rs.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
Powered by blists - more mailing lists