[PATCH next 5/6] staging: hv: fix memory leaks

From: Alexander Beregalov
Date: Wed Mar 09 2011 - 21:44:14 EST


Free resources before exit.

Signed-off-by: Alexander Beregalov <a.beregalov@xxxxxxxxx>
---
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 8f94f43..954164c 100644
--- a/drivers/staging/hv/hv_mouse.c
+++ b/drivers/staging/hv/hv_mouse.c
@@ -688,6 +688,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;
}

@@ -699,6 +700,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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/