summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKulikov Vasiliy <segooon@gmail.com>2010-07-16 20:13:51 +0400
committerGreg Kroah-Hartman <gregkh@suse.de>2010-07-22 14:33:00 -0700
commite3eb7cdd111eec56d201c4a2b20b743c746b6d99 (patch)
tree738e67b76cf63dea283e7dee3ad6efffb2e345a1
parentb99e1943fd416a5889300fe0fe58367aa3e5705f (diff)
staging: hv: check kzalloc() result
If kzalloc() fails free allocated resources and exit. Signed-off-by: Kulikov Vasiliy <segooon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/staging/hv/channel.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/hv/channel.c b/drivers/staging/hv/channel.c
index f047c5a7f64c..78d1aa5f7f9a 100644
--- a/drivers/staging/hv/channel.c
+++ b/drivers/staging/hv/channel.c
@@ -465,6 +465,8 @@ static int VmbusChannelCreateGpadlHeader(void *Kbuffer, u32 Size,
sizeof(struct vmbus_channel_gpadl_header) +
sizeof(struct gpa_range) + pageCount * sizeof(u64);
msgHeader = kzalloc(msgSize, GFP_KERNEL);
+ if (msgHeader == NULL)
+ goto nomem;
msgHeader->MessageSize = msgSize;
gpaHeader = (struct vmbus_channel_gpadl_header *)msgHeader->Msg;