[PATCH] staging/hv: Fix memory leak of storvsc_dev_add()

From: Andre Bartke
Date: Tue May 31 2011 - 17:46:42 EST


stor_device is not freed in storvsc_dev_add()
causing a memory leak in case of an allocation error.

Signed-off-by: Andre Bartke <andre.bartke@xxxxxxxxx>
---
drivers/staging/hv/storvsc.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/hv/storvsc.c b/drivers/staging/hv/storvsc.c
index 06cd327..92b44f4 100644
--- a/drivers/staging/hv/storvsc.c
+++ b/drivers/staging/hv/storvsc.c
@@ -414,6 +414,7 @@ int storvsc_dev_add(struct hv_device *device,
device_info->target_id = stor_device->target_id;

cleanup:
+ free_stor_device(stor_device);
return ret;
}

--
1.7.5.2

--
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/