提交 1e3e981a 编写于 作者: K Kumar Amit Mehta 提交者: Greg Kroah-Hartman

staging: lustre: lustre: obdclass: obd_mount.c: Fix NULL dereference

OBD_ALLOC_PTR(uuid) invokes kmalloc, which may return NULL. This fix
adds a check before dereferencing such pointer.
Signed-off-by: NKumar Amit Mehta <gmate.amit@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 ef99fd59
...@@ -376,6 +376,11 @@ int lustre_start_mgc(struct super_block *sb) ...@@ -376,6 +376,11 @@ int lustre_start_mgc(struct super_block *sb)
/* Random uuid for MGC allows easier reconnects */ /* Random uuid for MGC allows easier reconnects */
OBD_ALLOC_PTR(uuid); OBD_ALLOC_PTR(uuid);
if (!uuid) {
rc = -ENOMEM;
goto out_free;
}
ll_generate_random_uuid(uuidc); ll_generate_random_uuid(uuidc);
class_uuid_unparse(uuidc, uuid); class_uuid_unparse(uuidc, uuid);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册