staging: lustre: lustre: obdclass: obd_mount.c: Fix NULL dereference
Subsystems (2)
PATCH 1/1 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 <[email protected]>
--- drivers/staging/lustre/lustre/obdclass/obd_mount.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/staging/lustre/lustre/obdclass/obd_mount.c +5 -0
@@ -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);
Signature · 1 line
2.1.0