From 5e6e6232753482dc0024a319b9d8f611d7a80c19 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Sat, 18 Aug 2007 00:15:20 +0000 Subject: [CIFS] Check return code on failed alloc Signed-off-by: Cyrill Gorcunov Signed-off-by: Steve French --- fs/cifs/sess.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'fs/cifs/sess.c') diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c index 2ea027dda21..892be9b4d1f 100644 --- a/fs/cifs/sess.c +++ b/fs/cifs/sess.c @@ -372,6 +372,10 @@ CIFS_SessSetup(unsigned int xid, struct cifsSesInfo *ses, int first_time, /* 2000 big enough to fit max user, domain, NOS name etc. */ str_area = kmalloc(2000, GFP_KERNEL); + if (str_area == NULL) { + cifs_small_buf_release(smb_buf); + return -ENOMEM; + } bcc_ptr = str_area; ses->flags &= ~CIFS_SES_LANMAN; -- cgit v1.2.3