Linux-CIFS Archive mirror
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: linux-cifs@vger.kernel.org, samba-technical@lists.samba.org,
	Bharath SM <bharathsm@microsoft.com>,
	Paulo Alcantara <pc@manguebit.org>,
	Ronnie Sahlberg <ronniesahlberg@gmail.com>,
	Shyam Prasad N <sprasad@microsoft.com>,
	Steve French <sfrench@samba.org>, Tom Talpey <tom@talpey.com>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH] smb: client: Use common code in smb3_enum_snapshots()
Date: Wed, 8 Oct 2025 22:40:52 +0200	[thread overview]
Message-ID: <9bd9d534-d0a8-4058-a26e-622bf15b804c@web.de> (raw)

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


                 reply	other threads:[~2025-10-08 20:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9bd9d534-d0a8-4058-a26e-622bf15b804c@web.de \
    --to=markus.elfring@web.de \
    --cc=bharathsm@microsoft.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pc@manguebit.org \
    --cc=ronniesahlberg@gmail.com \
    --cc=samba-technical@lists.samba.org \
    --cc=sfrench@samba.org \
    --cc=sprasad@microsoft.com \
    --cc=tom@talpey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).