summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2015-02-11 13:13:05 -0500
committerDan Willemsen <dwillemsen@nvidia.com>2015-04-04 21:07:35 -0400
commit9bf82585aa24b6052855c119855abef92671d502 (patch)
treeb342047d4ddb99c265263bcf5c06a97d1df2389e /drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c
parent51b299c7dded7841ee83a6ca2bf1b6396db34920 (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/gk20a/ctrl_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c4
1 files changed, 2 insertions, 2 deletions
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