Staging: hv: return correct error values in Connection.c
Also check the kzalloc call return value. 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>
This commit is contained in:
parent
7e052d98f2
commit
8cad0af9a1
@ -93,7 +93,7 @@ int VmbusConnect(void)
|
|||||||
sizeof(struct vmbus_channel_initiate_contact),
|
sizeof(struct vmbus_channel_initiate_contact),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (msgInfo == NULL) {
|
if (msgInfo == NULL) {
|
||||||
ret = -1;
|
ret = -ENOMEM;
|
||||||
goto Cleanup;
|
goto Cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -195,6 +195,8 @@ int VmbusDisconnect(void)
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
msg = kzalloc(sizeof(struct vmbus_channel_message_header), GFP_KERNEL);
|
msg = kzalloc(sizeof(struct vmbus_channel_message_header), GFP_KERNEL);
|
||||||
|
if (!msg)
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
msg->MessageType = ChannelMessageUnload;
|
msg->MessageType = ChannelMessageUnload;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user