summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Beregalov <a.beregalov@gmail.com>2011-03-13 21:58:49 +0300
committerGreg Kroah-Hartman <gregkh@suse.de>2011-03-14 12:38:15 -0700
commit12bb12fac06d6212be9a5ed282c5670d4e90747f (patch)
treeca0e51747d424fd4bf85a2512f494305673b2eb4
parentdd9b15dc03075993f63a8a69667a3a8989aedfa1 (diff)
staging: hv: fix memory leaks
Free resources before exit. Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com> Cc: K. Y. Srinivasan <kys@microsoft.com> Cc: Haiyang Zhang <haiyangz@microsoft.com> Cc: Mike Sterling <mike.sterling@microsoft.com> Cc: Abhishek Kane <v-abkane@microsoft.com> Cc: Hank Janssen <hjanssen@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/staging/hv/hv_mouse.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/hv/hv_mouse.c b/drivers/staging/hv/hv_mouse.c
index 6fa462109ce9..50147f84741c 100644
--- a/drivers/staging/hv/hv_mouse.c
+++ b/drivers/staging/hv/hv_mouse.c
@@ -684,6 +684,7 @@ static int MousevscOnDeviceAdd(struct hv_device *Device, void *AdditionalInfo)
if (ret != 0) {
pr_err("unable to open channel: %d", ret);
+ FreeInputDevice(inputDevice);
return -1;
}
@@ -695,6 +696,7 @@ static int MousevscOnDeviceAdd(struct hv_device *Device, void *AdditionalInfo)
pr_err("unable to connect channel: %d", ret);
vmbus_close(Device->channel);
+ FreeInputDevice(inputDevice);
return ret;
}