aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifsencrypt.c
diff options
context:
space:
mode:
authorAnton Protopopov <a.s.protopopov@gmail.com>2016-02-10 12:50:21 -0500
committerSteve French <smfrench@gmail.com>2016-02-10 18:23:31 -0600
commit4b550af519854421dfec9f7732cdddeb057134b2 (patch)
tree1825ff56dc8ce3ff6e93f09675bcfe4a947bf24b /fs/cifs/cifsencrypt.c
parentcifs: fix potential overflow in cifs_compose_mount_options (diff)
downloadlinux-dev-4b550af519854421dfec9f7732cdddeb057134b2.tar.xz
linux-dev-4b550af519854421dfec9f7732cdddeb057134b2.zip
cifs: fix erroneous return value
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>
Diffstat (limited to 'fs/cifs/cifsencrypt.c')
-rw-r--r--fs/cifs/cifsencrypt.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/cifs/cifsencrypt.c b/fs/cifs/cifsencrypt.c
index afa09fce8151..e682b36a210f 100644
--- a/fs/cifs/cifsencrypt.c
+++ b/fs/cifs/cifsencrypt.c
@@ -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;
}