Skip to content

Commit

Permalink
Staging: hv: return correct error values in Connection.c
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bill Pemberton authored and Greg Kroah-Hartman committed May 11, 2010
1 parent 7e052d9 commit 8cad0af
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/staging/hv/Connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ int VmbusConnect(void)
sizeof(struct vmbus_channel_initiate_contact),
GFP_KERNEL);
if (msgInfo == NULL) {
ret = -1;
ret = -ENOMEM;
goto Cleanup;
}

Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 8cad0af

Please sign in to comment.