[<prev] [next>] [day] [month] [year] [list]
Message-ID: <AANLkTinX8Ax9ZJFdLk3Zjzc0CBh-gIIN0wg8YjQ-7PQP@mail.gmail.com>
Date: Tue, 18 May 2010 13:30:16 +0800
From: Steven Liu <lingjiujianke@...il.com>
To: drbd-dev@...ts.linbit.com, drbd-user@...ts.linbit.com,
linux-kernel@...r.kernel.org, liuqi@...nderst.com
Subject: [PATCH] drbd: Check-kmalloc-return-value before use it
Check-kmalloc-return-value before use it
Signed-off-by: Liu Qi <lingjiujianke@...il.com>
---
drivers/block/drbd/drbd_receiver.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/block/drbd/drbd_receiver.c
b/drivers/block/drbd/drbd_receiver.c
index 3f096e7..533df04 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -2977,6 +2977,10 @@ static int receive_uuids(struct drbd_conf
*mdev, struct p_header *h)
return FALSE;
p_uuid = kmalloc(sizeof(u64)*UI_EXTENDED_SIZE, GFP_NOIO);
+ if(p_uuid == NULL){
+ printk(KERN_ERR "Kmalloc p_uuid failed in %s \n", __func__);
+ return FALSE;
+ }
for (i = UI_CURRENT; i < UI_EXTENDED_SIZE; i++)
p_uuid[i] = be64_to_cpu(p->uuid[i]);
--
1.7.1
Best regards
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists