summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVandana Salve <vsalve@nvidia.com>2011-07-08 13:32:48 +0530
committerNiket Sirsi <nsirsi@nvidia.com>2011-07-13 18:11:04 -0700
commit22ede8940a036fed891427ef5fa357d13d5d5011 (patch)
tree3ab98cf17aeb3a6b6c60093408bab278492c75c1
parent485d76d553deaa1b76edceba41f83bcdf38d33e7 (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 Reviewed-on: http://git-master/r/40157 (cherry picked from commit c10173d70affb7117284b57fb0870c90823a5880) Change-Id: Ibe71a5daa8e6e3e2618e6b1a43338ff46fc27062 Reviewed-on: http://git-master/r/40837 Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Tested-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 f24476c2489a..63a7f94204c7 100644
--- a/drivers/video/tegra/dc/overlay.c
+++ b/drivers/video/tegra/dc/overlay.c
@@ -623,6 +623,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);