summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVandana Salve <vsalve@nvidia.com>2011-07-08 13:32:48 +0530
committerManish Tuteja <mtuteja@nvidia.com>2011-07-11 06:47:00 -0700
commitc10173d70affb7117284b57fb0870c90823a5880 (patch)
tree89e42b64802760ca90090530ef9e9fd9e0aa55c3
parent2b96783fd25eb2153cab2fb6ff92b2bacc809bed (diff)
video: tegra: dc: Reduce usage count of nvmap client
Carveout memory leak occured in video playback on abnormal termination as the tegra overlay driver didn't had the implementation to reduce the usage count of nvmap client on device closure. Hence on abnormal termination of mediaserver, the carveout memory remained allocated causing memory leak. The usage count of nvmap client for overlay driver is incremented on ioctl TEGRA_OVERLAY_IOCTL_SET_NVMAP_FD.It should be decremented on device closure. Added the code to decrement the uage count of nvmap client on release, so that the client and the carveout memory is free'd whenever the count reaches zero on successful as well as abnormal termination of mediaserver process. Similar implementation is done by NvHost channel driver, The NvHost drivers takes care of nvmap client usage count.i.e. decrement the uasge count of nvmap client which is incremented by NVHOST_IOCTL_CHANNEL_SET_NVMAP_FD ioctl. Bug 845676 Change-Id: I17b8d3c34adba5352af61355d8648b2611b62ef2 Reviewed-on: http://git-master/r/40157 Tested-by: Vandana Salve <vsalve@nvidia.com> Reviewed-by: Jonathan Mayo <jmayo@nvidia.com> Reviewed-by: Krishna Reddy <vdumpa@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
-rw-r--r--drivers/video/tegra/dc/overlay.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/video/tegra/dc/overlay.c b/drivers/video/tegra/dc/overlay.c
index edef51f8d2b0..095f4764b9a4 100644
--- a/drivers/video/tegra/dc/overlay.c
+++ b/drivers/video/tegra/dc/overlay.c
@@ -622,6 +622,7 @@ static int tegra_overlay_release(struct inode *inode, struct file *filp)
list_del(&client->list);
spin_unlock_irqrestore(&client->dev->clients_lock, flags);
+ nvmap_client_put(client->user_nvmap);
put_task_struct(client->task);
kfree(client);