Skip to content

Commit

Permalink
cifs: fix erroneous return value
Browse files Browse the repository at this point in the history
The setup_ntlmv2_rsp() function may return positive value ENOMEM instead
of -ENOMEM in case of kmalloc failure.

Signed-off-by: Anton Protopopov <a.s.protopopov@gmail.com>
CC: Stable <stable@vger.kernel.org>
Signed-off-by: Steve French <smfrench@gmail.com>
  • Loading branch information
Anton Protopopov authored and Steve French committed Feb 11, 2016
1 parent f34d69c commit 4b550af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/cifs/cifsencrypt.c
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ setup_ntlmv2_rsp(struct cifs_ses *ses, const struct nls_table *nls_cp)

ses->auth_key.response = kmalloc(baselen + tilen, GFP_KERNEL);
if (!ses->auth_key.response) {
rc = ENOMEM;
rc = -ENOMEM;
ses->auth_key.len = 0;
goto setup_ntlmv2_rsp_ret;
}
Expand Down

0 comments on commit 4b550af

Please sign in to comment.