From 9bf82585aa24b6052855c119855abef92671d502 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Wed, 11 Feb 2015 10:13:05 -0800 Subject: 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 Reviewed-on: http://git-master/r/706928 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Seshendra Gadagottu Reviewed-by: Deepak Nibade --- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 2 +- 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, err = PTR_ERR(file); goto clean_up; } - fd_install(fd, file); err = __gk20a_channel_open(g, file); if (err) goto clean_up_file; + fd_install(fd, file); args->channel_fd = fd; return 0; 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( err = PTR_ERR(file); goto clean_up; } - fd_install(fd, file); err = gk20a_as_alloc_share(&g->as, args->big_page_size, &as_share); if (err) goto clean_up_file; + fd_install(fd, file); file->private_data = as_share; args->as_fd = fd; @@ -203,12 +203,12 @@ static int gk20a_ctrl_open_tsg(struct gk20a *g, err = PTR_ERR(file); goto clean_up; } - fd_install(fd, file); err = gk20a_tsg_open(g, file); if (err) goto clean_up_file; + fd_install(fd, file); args->tsg_fd = fd; return 0; -- cgit v1.2.2