diff options
author | Deepak Nibade <dnibade@nvidia.com> | 2016-04-27 05:27:37 -0400 |
---|---|---|
committer | Terje Bergstrom <tbergstrom@nvidia.com> | 2016-05-02 11:18:27 -0400 |
commit | fb7c8c756c9aa207d76d8316c3482a306b36596a (patch) | |
tree | bf952759a9e5503df39cbe23ed08d36a1b67d0ee /drivers/gpu/nvgpu/gk20a | |
parent | c8da7546432015e9fe22f9cfa326983dabaf2419 (diff) |
gpu: nvgpu: fix resource leaks with gr_gk20a_elpg_protected_call
In gr_gk20a_elpg_protected_call(), we return with error value
if we fail to disable elpg
But since this is a #define'd function, we end up returning
from function which is using gr_gk20a_elpg_protected_call()
So in some cases it is possible that parent function does
not free up resources due to return statement in
gr_gk20a_elpg_protected_call()
Fix this by removing return statement, and execute rest
of the code if there is no error
Coverity id : 31980
Bug 200192125
Change-Id: Ic003b160b76820cdf9355f44658c23bfb2f3815f
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: http://git-master/r/1133404
GVS: Gerrit_Virtual_Submit
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_gk20a.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h index 3702c82d..681a0437 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h | |||
@@ -475,14 +475,14 @@ void gk20a_gr_clear_sm_hww(struct gk20a *g, | |||
475 | int err = 0; \ | 475 | int err = 0; \ |
476 | if (support_gk20a_pmu(g->dev) && g->elpg_enabled) {\ | 476 | if (support_gk20a_pmu(g->dev) && g->elpg_enabled) {\ |
477 | err = gk20a_pmu_disable_elpg(g); \ | 477 | err = gk20a_pmu_disable_elpg(g); \ |
478 | if (err) { \ | 478 | if (err) \ |
479 | gk20a_pmu_enable_elpg(g); \ | ||
480 | } \ | ||
481 | if (!err) { \ | ||
482 | err = func; \ | ||
483 | if (support_gk20a_pmu(g->dev) && g->elpg_enabled) \ | ||
479 | gk20a_pmu_enable_elpg(g); \ | 484 | gk20a_pmu_enable_elpg(g); \ |
480 | return err; \ | ||
481 | } \ | ||
482 | } \ | 485 | } \ |
483 | err = func; \ | ||
484 | if (support_gk20a_pmu(g->dev) && g->elpg_enabled) \ | ||
485 | gk20a_pmu_enable_elpg(g); \ | ||
486 | err; \ | 486 | err; \ |
487 | }) | 487 | }) |
488 | 488 | ||