diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2015-02-11 13:13:05 -0500 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2015-04-04 21:07:35 -0400 |
commit | 9bf82585aa24b6052855c119855abef92671d502 (patch) | |
tree | b342047d4ddb99c265263bcf5c06a97d1df2389e /drivers/gpu/nvgpu | |
parent | 51b299c7dded7841ee83a6ca2bf1b6396db34920 (diff) |
gpu: nvgpu: Install fd after no errors can happen
fd_install() should be called only once all other initialization is
done and no errors can happen.
Bug 1589104
Change-Id: I822511a64d4c6fa59c8e772a896dbd6818459c97
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/706928
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 4e68fe67..ddd3468c 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c | |||
@@ -837,12 +837,12 @@ int gk20a_channel_open_ioctl(struct gk20a *g, | |||
837 | err = PTR_ERR(file); | 837 | err = PTR_ERR(file); |
838 | goto clean_up; | 838 | goto clean_up; |
839 | } | 839 | } |
840 | fd_install(fd, file); | ||
841 | 840 | ||
842 | err = __gk20a_channel_open(g, file); | 841 | err = __gk20a_channel_open(g, file); |
843 | if (err) | 842 | if (err) |
844 | goto clean_up_file; | 843 | goto clean_up_file; |
845 | 844 | ||
845 | fd_install(fd, file); | ||
846 | args->channel_fd = fd; | 846 | args->channel_fd = fd; |
847 | return 0; | 847 | return 0; |
848 | 848 | ||
diff --git a/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c b/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c index 397b98bb..4dee3faf 100644 --- a/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c | |||
@@ -162,12 +162,12 @@ static int gk20a_ctrl_alloc_as( | |||
162 | err = PTR_ERR(file); | 162 | err = PTR_ERR(file); |
163 | goto clean_up; | 163 | goto clean_up; |
164 | } | 164 | } |
165 | fd_install(fd, file); | ||
166 | 165 | ||
167 | err = gk20a_as_alloc_share(&g->as, args->big_page_size, &as_share); | 166 | err = gk20a_as_alloc_share(&g->as, args->big_page_size, &as_share); |
168 | if (err) | 167 | if (err) |
169 | goto clean_up_file; | 168 | goto clean_up_file; |
170 | 169 | ||
170 | fd_install(fd, file); | ||
171 | file->private_data = as_share; | 171 | file->private_data = as_share; |
172 | 172 | ||
173 | args->as_fd = fd; | 173 | args->as_fd = fd; |
@@ -203,12 +203,12 @@ static int gk20a_ctrl_open_tsg(struct gk20a *g, | |||
203 | err = PTR_ERR(file); | 203 | err = PTR_ERR(file); |
204 | goto clean_up; | 204 | goto clean_up; |
205 | } | 205 | } |
206 | fd_install(fd, file); | ||
207 | 206 | ||
208 | err = gk20a_tsg_open(g, file); | 207 | err = gk20a_tsg_open(g, file); |
209 | if (err) | 208 | if (err) |
210 | goto clean_up_file; | 209 | goto clean_up_file; |
211 | 210 | ||
211 | fd_install(fd, file); | ||
212 | args->tsg_fd = fd; | 212 | args->tsg_fd = fd; |
213 | return 0; | 213 | return 0; |
214 | 214 | ||