summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGujulan Elango, Hari Prasath (H.) <hgujulan@visteon.com>2015-05-13 10:36:28 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-05-31 09:19:37 +0900
commitdb562e8154035b2dec9fc8e506450bc52a9adbe1 (patch)
tree44a698f0b59b349333bb76a614f12f99e8ea8929
parent58973deb5b831eafa3eb04efe8ed85dbfe52aa18 (diff)
downloadop-kernel-dev-db562e8154035b2dec9fc8e506450bc52a9adbe1.zip
op-kernel-dev-db562e8154035b2dec9fc8e506450bc52a9adbe1.tar.gz
staging: lustre: check kzalloc return value
check the return value of kzalloc before accessing the memory pointer Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/lustre/lustre/llite/llite_lib.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c
index 61acc70..e759da3 100644
--- a/drivers/staging/lustre/lustre/llite/llite_lib.c
+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
@@ -284,6 +284,10 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
char *buf;
buf = kzalloc(PAGE_CACHE_SIZE, GFP_KERNEL);
+ if (!buf) {
+ err = -ENOMEM;
+ goto out_md_fid;
+ }
obd_connect_flags2str(buf, PAGE_CACHE_SIZE,
valid ^ CLIENT_CONNECT_MDT_REQD, ",");
LCONSOLE_ERROR_MSG(0x170, "Server %s does not support feature(s) needed for correct operation of this client (%s). Please upgrade server or downgrade client.\n",
OpenPOWER on IntegriCloud