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>
This commit is contained in:
Родитель
58973deb5b
Коммит
db562e8154
|
@ -284,6 +284,10 @@ static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
|
||||||
char *buf;
|
char *buf;
|
||||||
|
|
||||||
buf = kzalloc(PAGE_CACHE_SIZE, GFP_KERNEL);
|
buf = kzalloc(PAGE_CACHE_SIZE, GFP_KERNEL);
|
||||||
|
if (!buf) {
|
||||||
|
err = -ENOMEM;
|
||||||
|
goto out_md_fid;
|
||||||
|
}
|
||||||
obd_connect_flags2str(buf, PAGE_CACHE_SIZE,
|
obd_connect_flags2str(buf, PAGE_CACHE_SIZE,
|
||||||
valid ^ CLIENT_CONNECT_MDT_REQD, ",");
|
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",
|
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",
|
||||||
|
|
Загрузка…
Ссылка в новой задаче