From: Bill Pemberton <wfp5p@virginia.edu>
Date: Wed, 5 May 2010 19:27:31 +0000 (-0400)
Subject: Staging: hv: remove ASSERT()s in ChannelMgt.c
X-Git-Tag: firefly_0821_release~9833^2~2055^2^2~177
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=75910f236a30bded00f078cab994f35a7171c39b;p=firefly-linux-kernel-4.4.55.git

Staging: hv: remove ASSERT()s in ChannelMgt.c

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Hank Janssen <hjanssen@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---

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;