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: Kumar Amit Mehta <gmate.amit@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
ef99fd59f1
commit
1e3e981ad5
@ -376,6 +376,11 @@ int lustre_start_mgc(struct super_block *sb)
|
||||
|
||||
/* Random uuid for MGC allows easier reconnects */
|
||||
OBD_ALLOC_PTR(uuid);
|
||||
if (!uuid) {
|
||||
rc = -ENOMEM;
|
||||
goto out_free;
|
||||
}
|
||||
|
||||
ll_generate_random_uuid(uuidc);
|
||||
class_uuid_unparse(uuidc, uuid);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user