diff options
author | Bill Pemberton | 2010-05-05 21:27:32 +0200 |
---|---|---|
committer | Greg Kroah-Hartman | 2010-05-11 20:36:13 +0200 |
commit | 8cad0af9a1a1882cd00f12f8f7c79690f563b1d7 (patch) | |
tree | f3f288b147d8187f732ab395cd008855e706d45f /drivers/staging/hv/Connection.c | |
parent | Staging: hv: check return value of osd_PageAlloc() (diff) | |
download | kernel-qcow2-linux-8cad0af9a1a1882cd00f12f8f7c79690f563b1d7.tar.gz kernel-qcow2-linux-8cad0af9a1a1882cd00f12f8f7c79690f563b1d7.tar.xz kernel-qcow2-linux-8cad0af9a1a1882cd00f12f8f7c79690f563b1d7.zip |
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>
Diffstat (limited to 'drivers/staging/hv/Connection.c')
-rw-r--r-- | drivers/staging/hv/Connection.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/hv/Connection.c b/drivers/staging/hv/Connection.c index dbf00560e0ac..1e4111412ab6 100644 --- a/drivers/staging/hv/Connection.c +++ b/drivers/staging/hv/Connection.c @@ -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; |