[PATCH 961/961] staging: hv: fix memory leaks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Alexander Beregalov <a.beregalov@xxxxxxxxx>

Free resources before exit.

Signed-off-by: Alexander Beregalov <a.beregalov@xxxxxxxxx>
Cc: K. Y. Srinivasan <kys@xxxxxxxxxxxxx>
Cc: Haiyang Zhang <haiyangz@xxxxxxxxxxxxx>
Cc: Mike Sterling <mike.sterling@xxxxxxxxxxxxx>
Cc: Abhishek Kane <v-abkane@xxxxxxxxxxxxx>
Cc: Hank Janssen <hjanssen@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>
---
 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
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux