From 12bb12fac06d6212be9a5ed282c5670d4e90747f Mon Sep 17 00:00:00 2001 From: Alexander Beregalov Date: Sun, 13 Mar 2011 21:58:49 +0300 Subject: staging: hv: fix memory leaks Free resources before exit. Signed-off-by: Alexander Beregalov Cc: K. Y. Srinivasan Cc: Haiyang Zhang Cc: Mike Sterling Cc: Abhishek Kane Cc: Hank Janssen Signed-off-by: Greg Kroah-Hartman diff --git a/drivers/staging/hv/hv_mouse.c b/drivers/staging/hv/hv_mouse.c index 6fa4621..50147f8 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; } -- cgit v0.10.2