aboutsummaryrefslogtreecommitdiff
path: root/drivers/block/drbd/drbd_receiver.c
diff options
context:
space:
mode:
authorJing Wang <windsdaemon@gmail.com>2012-10-25 15:00:56 +0800
committerPhilipp Reisner <philipp.reisner@linbit.com>2012-11-09 14:22:10 +0100
commit063eacf88cc1394ece125d106c05cba1ca03aa3d (patch)
tree11e2d734cf848a5f73657f2342a760baa1360a7a /drivers/block/drbd/drbd_receiver.c
parent986836503e49ccf7e84b813715d344964ec93566 (diff)
downloadvexpress-lsk-063eacf88cc1394ece125d106c05cba1ca03aa3d.tar.gz
drbd: check return of kmalloc in receive_uuids
Signed-off-by: Jing Wang <windsdaemon@gmail.com> Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd/drbd_receiver.c')
-rw-r--r--drivers/block/drbd/drbd_receiver.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index 0331ad0b61e..9a9d4fd264a 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]);