[PATCH 400/577] Staging: hv: remove ASSERT()s in ChannelMgt.c
Greg Kroah-Hartman
gregkh at suse.de
Fri May 21 20:02:09 UTC 2010
From: Bill Pemberton <wfp5p at virginia.edu>
Signed-off-by: Bill Pemberton <wfp5p at virginia.edu>
Cc: Hank Janssen <hjanssen at microsoft.com>
Cc: Haiyang Zhang <haiyangz at microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh at suse.de>
---
drivers/staging/hv/ChannelMgmt.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/hv/ChannelMgmt.c b/drivers/staging/hv/ChannelMgmt.c
index 445506d..05e6699 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;
--
1.7.0.3
More information about the devel
mailing list