summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGagan Grover <ggrover@nvidia.com>2016-11-04 16:39:33 +0530
committerWinnie Hsu <whsu@nvidia.com>2016-11-08 09:52:40 -0800
commit6454f3735146944761701de980bd6205dc979c15 (patch)
tree0d488aaef4d3f8e1288234a834b09eb98933840c
parent2caf4affa29d959a592727d87d0dec200b98a05b (diff)
video: tegra: host: Prevent the race between channel open and close
Moved fd_install() at the end of the channel_open ioctl. So, the fd can't be used until open ioctl completes. Bug 1832094 Change-Id: Ib33d43bf5164418a38f98677d4e3295f3d1c1450 Signed-off-by: Gagan Grover <ggrover@nvidia.com> Reviewed-on: http://git-master/r/1248180 (cherry picked from commit e6a41d5c0049c2878543006b67b7ee2b2bbda2ab) Reviewed-on: http://git-master/r/1249505 Reviewed-by: Winnie Hsu <whsu@nvidia.com> Tested-by: Winnie Hsu <whsu@nvidia.com>
-rw-r--r--drivers/video/tegra/host/bus_client.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/video/tegra/host/bus_client.c b/drivers/video/tegra/host/bus_client.c
index 267a977c410b..ee21c80e6871 100644
--- a/drivers/video/tegra/host/bus_client.c
+++ b/drivers/video/tegra/host/bus_client.c
@@ -785,7 +785,6 @@ static long nvhost_channelctl(struct file *filp,
put_unused_fd(fd);
break;
}
- fd_install(fd, file);
err = __nvhost_channelopen(NULL, priv->ch, file);
if (err) {
@@ -795,6 +794,7 @@ static long nvhost_channelctl(struct file *filp,
}
((struct nvhost_channel_open_args *)buf)->channel_fd = fd;
+ fd_install(fd, file);
break;
}
case NVHOST_IOCTL_CHANNEL_GET_SYNCPOINTS: