Browse Source

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>
Bill Pemberton 15 years ago
parent
commit
75910f236a
1 changed files with 7 additions and 1 deletions
  1. 7 1
      drivers/staging/hv/ChannelMgmt.c

+ 7 - 1
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;