From: Markus Elfring Date: Tue, 7 Oct 2025 14:32:25 +0000 (+0200) Subject: smb: client: Return a status code only as a constant in cifs_spnego_key_instantiate() X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=0a98b40b8fe1bdebf3cb78924cef60af322c4437;p=users%2Fhch%2Fmisc.git smb: client: Return a status code only as a constant in cifs_spnego_key_instantiate() * 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 Acked-by: Enzo Matsumiya Signed-off-by: Steve French --- 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