Skip to content

Commit 0a98b40

Browse files
elfringsmfrench
authored andcommitted
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 <elfring@users.sourceforge.net> Acked-by: Enzo Matsumiya <ematsumiya@suse.de> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent 61da08e commit 0a98b40

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

fs/smb/client/cifs_spnego.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,14 @@ static const struct cred *spnego_cred;
2424
static int
2525
cifs_spnego_key_instantiate(struct key *key, struct key_preparsed_payload *prep)
2626
{
27-
char *payload;
28-
int ret;
27+
char *payload = kmemdup(prep->data, prep->datalen, GFP_KERNEL);
2928

30-
ret = -ENOMEM;
31-
payload = kmemdup(prep->data, prep->datalen, GFP_KERNEL);
3229
if (!payload)
33-
goto error;
30+
return -ENOMEM;
3431

3532
/* attach the data */
3633
key->payload.data[0] = payload;
37-
ret = 0;
38-
39-
error:
40-
return ret;
34+
return 0;
4135
}
4236

4337
static void

0 commit comments

Comments
 (0)