]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
gpu: nvgpu: Install fd after no errors can happen
authorTerje Bergstrom <tbergstrom@nvidia.com>
Wed, 11 Feb 2015 18:13:05 +0000 (10:13 -0800)
committerTerje Bergstrom <tbergstrom@nvidia.com>
Mon, 23 Feb 2015 15:53:27 +0000 (07:53 -0800)
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>
drivers/gpu/nvgpu/gk20a/channel_gk20a.c
drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c

index 4e68fe671cd700bf1d1aad2fc25c342239031042..ddd3468c76e78ec29ea5c603dc999babb70769fc 100644 (file)
@@ -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;
 
index 397b98bb4b0e4d32edb4772515ef45e871389e04..4dee3faf8a2c60c125c69539dfa7b27f5f97e57d 100644 (file)
@@ -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;