summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJie Zhou <b30303@freescale.com>2010-07-26 12:30:54 +0800
committerJie Zhou <b30303@freescale.com>2010-07-26 14:10:53 +0800
commitd2dab9fe6b75d20156e6bcb378fc2b59f278e7eb (patch)
treedfdbbb2a7fd0cf67e2ef853af4a2e50bc322deef
parent4356737e33c837d038b99b9c77e1a3310f162e19 (diff)
ENGR00125556 GPU: Check device refcnt before free memstore
memstore should only be freed when the device has been stopped with device->refcnt equalling zero. Signed-off-by: Jie Zhou <b30303@freescale.com>
-rw-r--r--drivers/mxc/amd-gpu/common/gsl_device.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/mxc/amd-gpu/common/gsl_device.c b/drivers/mxc/amd-gpu/common/gsl_device.c
index bc2a427470ed..6fc51eb1bdc2 100644
--- a/drivers/mxc/amd-gpu/common/gsl_device.c
+++ b/drivers/mxc/amd-gpu/common/gsl_device.c
@@ -174,9 +174,10 @@ kgsl_device_close(gsl_device_t *device)
}
// DumpX allocates memstore from MMU aperture
- if (device->memstore.hostptr && !(gsl_driver.flags_debug & GSL_DBGFLAGS_DUMPX))
+ if ((device->refcnt == 0) && device->memstore.hostptr
+ && !(gsl_driver.flags_debug & GSL_DBGFLAGS_DUMPX))
{
- //kgsl_sharedmem_free0(&device->memstore, GSL_CALLER_PROCESSID_GET());
+ kgsl_sharedmem_free0(&device->memstore, GSL_CALLER_PROCESSID_GET());
}
#ifndef _LINUX