Explorar o código

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>
Alexander Beregalov %!s(int64=14) %!d(string=hai) anos
pai
achega
12bb12fac0
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      drivers/staging/hv/hv_mouse.c

+ 2 - 0
drivers/staging/hv/hv_mouse.c

@@ -684,6 +684,7 @@ static int MousevscOnDeviceAdd(struct hv_device *Device, void *AdditionalInfo)
 
 
 	if (ret != 0) {
 	if (ret != 0) {
 		pr_err("unable to open channel: %d", ret);
 		pr_err("unable to open channel: %d", ret);
+		FreeInputDevice(inputDevice);
 		return -1;
 		return -1;
 	}
 	}
 
 
@@ -695,6 +696,7 @@ static int MousevscOnDeviceAdd(struct hv_device *Device, void *AdditionalInfo)
 		pr_err("unable to connect channel: %d", ret);
 		pr_err("unable to connect channel: %d", ret);
 
 
 		vmbus_close(Device->channel);
 		vmbus_close(Device->channel);
+		FreeInputDevice(inputDevice);
 		return ret;
 		return ret;
 	}
 	}