[<prev] [next>] [day] [month] [year] [list]
Message-ID: <6de9dea4-205b-4fb6-a785-498ce31636e3@web.de>
Date: Tue, 7 Oct 2025 16:45:58 +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: Return a status code only as a constant in
cifs_spnego_key_instantiate()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Tue, 7 Oct 2025 16:32:25 +0200
* Return a status code without storing it in an intermediate variable.
* Delete the local variable “ret” and the label “error”
which became unnecessary with this refactoring.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
fs/smb/client/cifs_spnego.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/fs/smb/client/cifs_spnego.c b/fs/smb/client/cifs_spnego.c
index 43b86fa4d695..9891f55bac1e 100644
--- a/fs/smb/client/cifs_spnego.c
+++ b/fs/smb/client/cifs_spnego.c
@@ -24,20 +24,14 @@ static const struct cred *spnego_cred;
static int
cifs_spnego_key_instantiate(struct key *key, struct key_preparsed_payload *prep)
{
- char *payload;
- int ret;
+ char *payload = kmemdup(prep->data, prep->datalen, GFP_KERNEL);
- ret = -ENOMEM;
- payload = kmemdup(prep->data, prep->datalen, GFP_KERNEL);
if (!payload)
- goto error;
+ return -ENOMEM;
/* attach the data */
key->payload.data[0] = payload;
- ret = 0;
-
-error:
- return ret;
+ return 0;
}
static void
--
2.51.0
Powered by blists - more mailing lists