aboutsummaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorJohan Mossberg <johan.xx.mossberg@stericsson.com>2011-03-23 12:03:36 +0100
committerRobert Marklund <robert.marklund@stericsson.com>2011-10-05 11:18:44 +0200
commit1406d7ad9dd29a5c42e8c4f89df9b0451ed52806 (patch)
tree68ae4814a8c711b28e7e800291ea1da62050ba88 /drivers/misc
parent85e74c374721c752b2d3c9dc39c75fbda895ccfc (diff)
HWMEM: Reset ref count in clean_alloc
When hwmem_alloc fails to alloc virtual memory for the kernel mapping it will call clean_alloc with a non-zero ref count. If the ref count is not reset in that case we will leak HWMEM memory. ST-Ericsson ID: 330377 ST-Ericsson FOSS-OUT ID: STETL-FOSS-OUT-10068 Change-Id: I4c203bbd090a119d1e99cc7d294e827ab8a6e9e7 Signed-off-by: Johan Mossberg <johan.xx.mossberg@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/18942 Reviewed-by: QATOOLS Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/hwmem/hwmem-main.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/misc/hwmem/hwmem-main.c b/drivers/misc/hwmem/hwmem-main.c
index fbfd8502a1d..9223bdd013b 100644
--- a/drivers/misc/hwmem/hwmem-main.c
+++ b/drivers/misc/hwmem/hwmem-main.c
@@ -154,6 +154,7 @@ static void clean_alloc(struct hwmem_alloc *alloc)
}
alloc->flags = 0;
+ atomic_set(&alloc->ref_cnt, 0);
clean_hwmem_alloc_threadg_info_list(alloc);