From: Bill Pemberton Date: Wed, 5 May 2010 19:27:31 +0000 (-0400) Subject: Staging: hv: remove ASSERT()s in ChannelMgt.c X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=75910f236a30bded00f078cab994f35a7171c39b;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git Staging: hv: remove ASSERT()s in ChannelMgt.c Signed-off-by: Bill Pemberton Cc: Hank Janssen Cc: Haiyang Zhang Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/hv/ChannelMgmt.c b/drivers/staging/hv/ChannelMgmt.c index 445506d45edb..05e6699e3c78 100644 --- a/drivers/staging/hv/ChannelMgmt.c +++ b/drivers/staging/hv/ChannelMgmt.c @@ -753,9 +753,15 @@ int VmbusChannelRequestOffers(void) msgInfo = kmalloc(sizeof(*msgInfo) + sizeof(struct vmbus_channel_message_header), GFP_KERNEL); - ASSERT(msgInfo != NULL); + if (!msgInfo) + return -ENOMEM; msgInfo->WaitEvent = osd_WaitEventCreate(); + if (!msgInfo->WaitEvent) { + kfree(msgInfo); + return -ENOMEM; + } + msg = (struct vmbus_channel_message_header *)msgInfo->Msg; msg->MessageType = ChannelMessageRequestOffers;