From: Parinay Kondekar Date: Sun, 6 Dec 2015 18:03:17 +0000 (+0530) Subject: LU-6518 obd: Unhandled possible allocation failure in lustre_start_mgc X-Git-Tag: 2.8.54~14 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=66430ae381add9095d421887a4cf63fbe7f71407 LU-6518 obd: Unhandled possible allocation failure in lustre_start_mgc Patch to handle un-handled possible allocation failure of struct obd_uuid. Change-Id: Ib19d4c53a6dae5e2f6a80e0fdf755fa7aac81fd1 Signed-off-by: Parinay Kondekar Reviewed-on: http://review.whamcloud.com/17493 Tested-by: Jenkins Reviewed-by: Dmitry Eremin Reviewed-by: Frank Zago Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/obdclass/obd_mount.c b/lustre/obdclass/obd_mount.c index 6b1ae94..3aa9d28 100644 --- a/lustre/obdclass/obd_mount.c +++ b/lustre/obdclass/obd_mount.c @@ -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);