Whamcloud - gitweb
LU-6518 obd: Unhandled possible allocation failure in lustre_start_mgc 93/17493/8
authorParinay Kondekar <parinay.kondekar@seagate.com>
Sun, 6 Dec 2015 18:03:17 +0000 (23:33 +0530)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 2 Jun 2016 04:41:35 +0000 (04:41 +0000)
Patch to handle un-handled possible allocation failure
of struct obd_uuid.

Change-Id: Ib19d4c53a6dae5e2f6a80e0fdf755fa7aac81fd1
Signed-off-by: Parinay Kondekar <parinay.kondekar@seagate.com>
Reviewed-on: http://review.whamcloud.com/17493
Tested-by: Jenkins
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Reviewed-by: Frank Zago <fzago@cray.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/obdclass/obd_mount.c

index 6b1ae94..3aa9d28 100644 (file)
@@ -398,6 +398,9 @@ int lustre_start_mgc(struct super_block *sb)
 
         /* Random uuid for MGC allows easier reconnects */
         OBD_ALLOC_PTR(uuid);
+       if (uuid == NULL)
+               GOTO(out_free, rc = -ENOMEM);
+
         ll_generate_random_uuid(uuidc);
         class_uuid_unparse(uuidc, uuid);