summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/perf
diff options
context:
space:
mode:
authorVijayakumar <vsubbu@nvidia.com>2017-01-05 05:50:51 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-01-05 13:38:45 -0500
commit4099785e2d60377459845b8fa886ab6be1a1d8e4 (patch)
tree600523620fcb2e80df04d1d684fcd7a1c8c8eb28 /drivers/gpu/nvgpu/perf
parent18a5111380343690148122434c8d3e1b9cfe48a5 (diff)
gpu: nvgpu: free boardobj if construct hits an err
During construct of some VFE/CLK boardobjs, some data is filled after a boardobj allocation is done. Free up boardobj memory if an error is encountered in the data filling. Coverity ID 490171 Coverity ID 490172 Bug 200192125 Change-Id: I20621f7f9f9e379b8dced4905cd417c2ffa905b0 Signed-off-by: Vijayakumar <vsubbu@nvidia.com> Reviewed-on: http://git-master/r/1280700 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/perf')
-rw-r--r--drivers/gpu/nvgpu/perf/vfe_var.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/perf/vfe_var.c b/drivers/gpu/nvgpu/perf/vfe_var.c
index f4c3f276..f43e68e2 100644
--- a/drivers/gpu/nvgpu/perf/vfe_var.c
+++ b/drivers/gpu/nvgpu/perf/vfe_var.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License, 5 * under the terms and conditions of the GNU General Public License,
@@ -668,12 +668,19 @@ static u32 vfe_var_construct_single_sensed_fuse(struct gk20a *g,
668 if (pvfevar->vfield_info.fuse.segment_count == 0) { 668 if (pvfevar->vfield_info.fuse.segment_count == 0) {
669 gk20a_err(dev_from_gk20a(g), "unable to get fuse reg info %x", 669 gk20a_err(dev_from_gk20a(g), "unable to get fuse reg info %x",
670 pvfevar->vfield_info.v_field_id); 670 pvfevar->vfield_info.v_field_id);
671 return -EINVAL; 671 status = -EINVAL;
672 goto exit;
672 } 673 }
673 if (pvfevar->vfield_ver_info.fuse.segment_count == 0) { 674 if (pvfevar->vfield_ver_info.fuse.segment_count == 0) {
674 gk20a_err(dev_from_gk20a(g), "unable to get fuse reg info %x", 675 gk20a_err(dev_from_gk20a(g), "unable to get fuse reg info %x",
675 pvfevar->vfield_ver_info.v_field_id_ver); 676 pvfevar->vfield_ver_info.v_field_id_ver);
676 return -EINVAL; 677 status = -EINVAL;
678 goto exit;
679 }
680exit:
681 if (status) {
682 if (*ppboardobj != NULL)
683 (*ppboardobj)->destruct(*ppboardobj);
677 } 684 }
678 return status; 685 return status;
679} 686}