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
1 changed files with 5 additions and 0 deletions
|
@ -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);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue