Skip to content

Commit

Permalink
staging: hv: fix memory leaks
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
alexb0 authored and gregkh committed Mar 14, 2011
1 parent dd9b15d commit 12bb12f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/staging/hv/hv_mouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down

0 comments on commit 12bb12f

Please sign in to comment.