From: Bill Pemberton <[email protected]>

Signed-off-by: Bill Pemberton <[email protected]>
Cc: Hank Janssen <[email protected]>
Cc: Haiyang Zhang <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
 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

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel

Reply via email to