[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20070817191329.GA7218@cvg>
Date: Fri, 17 Aug 2007 23:13:29 +0400
From: Cyrill Gorcunov <gorcunov@...il.com>
To: Steve French <sfrench@...ba.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: [PATCH] CIFS: check for granted memory
This patch adds just a check for granted memory
to prevent possible NULL pointer usage.
Signed-off-by: Cyrill Gorcunov <gorcunov@...il.com>
---
fs/cifs/sess.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c
index 2ea027d..892be9b 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;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists