Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1e3e981a authored by Kumar Amit Mehta's avatar Kumar Amit Mehta Committed by Greg Kroah-Hartman
Browse files

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: default avatarKumar Amit Mehta <gmate.amit@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ef99fd59
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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);