diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2017-01-19 18:35:47 -0500 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-01-26 13:53:06 -0500 |
commit | 8fa68aeb045e8974a295a6d1f7d30f127398a8d2 (patch) | |
tree | 85c0106a18e292528c1c5ddba72aa172df6b5fb2 /drivers/gpu/nvgpu | |
parent | 29400cbbae01472ddb103fe6bd8a3a8619f63f80 (diff) |
gpu: nvgpu: Free nvgpu_clk_dev in case of error
If nvgpu_clk_arb_install_fd() gets an error from
nvgpu_clk_notification_queue_alloc(), it fails to free the
nvgpu_clk_dev that it allocated earlier.
Direct the error case to call an appropriate fail label.
Coverity ID 1862040
Change-Id: I1d804d4f5261ec64831938f997f9efc3f2700b60
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1291683
Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r-- | drivers/gpu/nvgpu/clk/clk_arb.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/clk/clk_arb.c b/drivers/gpu/nvgpu/clk/clk_arb.c index 2dee209e..550c77e0 100644 --- a/drivers/gpu/nvgpu/clk/clk_arb.c +++ b/drivers/gpu/nvgpu/clk/clk_arb.c | |||
@@ -477,9 +477,10 @@ static int nvgpu_clk_arb_install_fd(struct gk20a *g, | |||
477 | 477 | ||
478 | status = nvgpu_clk_notification_queue_alloc(&dev->queue, | 478 | status = nvgpu_clk_notification_queue_alloc(&dev->queue, |
479 | DEFAULT_EVENT_NUMBER); | 479 | DEFAULT_EVENT_NUMBER); |
480 | if (status < 0) | 480 | if (status < 0) { |
481 | return status; | 481 | err = status; |
482 | 482 | goto fail; | |
483 | } | ||
483 | 484 | ||
484 | fd = get_unused_fd_flags(O_RDWR); | 485 | fd = get_unused_fd_flags(O_RDWR); |
485 | if (fd < 0) { | 486 | if (fd < 0) { |