summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r--drivers/gpu/nvgpu/clk/clk_arb.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/clk/clk_arb.c b/drivers/gpu/nvgpu/clk/clk_arb.c
index c440dc3b..e8213b47 100644
--- a/drivers/gpu/nvgpu/clk/clk_arb.c
+++ b/drivers/gpu/nvgpu/clk/clk_arb.c
@@ -332,15 +332,17 @@ static int nvgpu_clk_arb_install_fd(struct gk20a *g,
332 return -ENOMEM; 332 return -ENOMEM;
333 333
334 fd = get_unused_fd_flags(O_RDWR); 334 fd = get_unused_fd_flags(O_RDWR);
335 if (fd < 0) 335 if (fd < 0) {
336 return fd; 336 err = fd;
337 goto fail;
338 }
337 339
338 name = kasprintf(GFP_KERNEL, "%s-clk-fd%d", dev_name(g->dev), fd); 340 name = kasprintf(GFP_KERNEL, "%s-clk-fd%d", dev_name(g->dev), fd);
339 file = anon_inode_getfile(name, fops, dev, O_RDWR); 341 file = anon_inode_getfile(name, fops, dev, O_RDWR);
340 kfree(name); 342 kfree(name);
341 if (IS_ERR(file)) { 343 if (IS_ERR(file)) {
342 err = PTR_ERR(file); 344 err = PTR_ERR(file);
343 goto fail; 345 goto fail_fd;
344 } 346 }
345 347
346 fd_install(fd, file); 348 fd_install(fd, file);
@@ -357,9 +359,10 @@ static int nvgpu_clk_arb_install_fd(struct gk20a *g,
357 359
358 return fd; 360 return fd;
359 361
362fail_fd:
363 put_unused_fd(fd);
360fail: 364fail:
361 kfree(dev); 365 kfree(dev);
362 put_unused_fd(fd);
363 366
364 return err; 367 return err;
365} 368}