Staging: hv: return correct error values in Connection.c
[firefly-linux-kernel-4.4.55.git] / drivers / staging / hv / Connection.c
index dbf00560e0ac765340405b6421df1b4917d3e25f..1e4111412ab6e639d971c518320ce97b83b9a351 100644 (file)
@@ -93,7 +93,7 @@ int VmbusConnect(void)
                          sizeof(struct vmbus_channel_initiate_contact),
                          GFP_KERNEL);
        if (msgInfo == NULL) {
-               ret = -1;
+               ret = -ENOMEM;
                goto Cleanup;
        }
 
@@ -195,6 +195,8 @@ int VmbusDisconnect(void)
                return -1;
 
        msg = kzalloc(sizeof(struct vmbus_channel_message_header), GFP_KERNEL);
+       if (!msg)
+               return -ENOMEM;
 
        msg->MessageType = ChannelMessageUnload;