From: Alexander Beregalov <[email protected]>

Free resources before exit.

Signed-off-by: Alexander Beregalov <[email protected]>
Cc: K. Y. Srinivasan <[email protected]>
Cc: Haiyang Zhang <[email protected]>
Cc: Mike Sterling <[email protected]>
Cc: Abhishek Kane <[email protected]>
Cc: Hank Janssen <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
---
 drivers/staging/hv/hv_mouse.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

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;
        }
 
-- 
1.7.4.1

_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel

Reply via email to