From 063eacf88cc1394ece125d106c05cba1ca03aa3d Mon Sep 17 00:00:00 2001 From: Jing Wang Date: Thu, 25 Oct 2012 15:00:56 +0800 Subject: drbd: check return of kmalloc in receive_uuids Signed-off-by: Jing Wang Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 0331ad0..9a9d4fd 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c @@ -3663,6 +3663,10 @@ static int receive_uuids(struct drbd_tconn *tconn, struct packet_info *pi) return config_unknown_volume(tconn, pi); p_uuid = kmalloc(sizeof(u64)*UI_EXTENDED_SIZE, GFP_NOIO); + if (!p_uuid) { + dev_err(DEV, "kmalloc of p_uuid failed\n"); + return false; + } for (i = UI_CURRENT; i < UI_EXTENDED_SIZE; i++) p_uuid[i] = be64_to_cpu(p->uuid[i]); -- cgit v0.10.2