summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/nvgpu/clk/clk_prog.c19
-rw-r--r--drivers/gpu/nvgpu/perf/vfe_var.c21
2 files changed, 23 insertions, 17 deletions
diff --git a/drivers/gpu/nvgpu/clk/clk_prog.c b/drivers/gpu/nvgpu/clk/clk_prog.c
index 22add3b0..d4876da8 100644
--- a/drivers/gpu/nvgpu/clk/clk_prog.c
+++ b/drivers/gpu/nvgpu/clk/clk_prog.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2016-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,
@@ -182,13 +182,16 @@ static u32 devinit_get_clk_prog_table(struct gk20a *g,
182 182
183 gk20a_dbg_info(""); 183 gk20a_dbg_info("");
184 184
185 if (g->ops.bios.get_perf_table_ptrs) { 185 if (!g->ops.bios.get_perf_table_ptrs) {
186 clkprogs_tbl_ptr = (u8 *)g->ops.bios.get_perf_table_ptrs(g, 186 status = -EINVAL;
187 g->bios.clock_token, CLOCK_PROGRAMMING_TABLE); 187 goto done;
188 if (clkprogs_tbl_ptr == NULL) { 188 }
189 status = -EINVAL; 189
190 goto done; 190 clkprogs_tbl_ptr = (u8 *)g->ops.bios.get_perf_table_ptrs(g,
191 } 191 g->bios.clock_token, CLOCK_PROGRAMMING_TABLE);
192 if (clkprogs_tbl_ptr == NULL) {
193 status = -EINVAL;
194 goto done;
192 } 195 }
193 196
194 memcpy(&header, clkprogs_tbl_ptr, hszfmt); 197 memcpy(&header, clkprogs_tbl_ptr, hszfmt);
diff --git a/drivers/gpu/nvgpu/perf/vfe_var.c b/drivers/gpu/nvgpu/perf/vfe_var.c
index f43e68e2..65ede64a 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) 2017, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2016-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,
@@ -868,14 +868,17 @@ static u32 devinit_get_vfe_var_table(struct gk20a *g,
868 868
869 gk20a_dbg_info(""); 869 gk20a_dbg_info("");
870 870
871 if (g->ops.bios.get_perf_table_ptrs) { 871 if (!g->ops.bios.get_perf_table_ptrs) {
872 vfevars_tbl_ptr = (u8 *)g->ops.bios.get_perf_table_ptrs(g, 872 status = -EINVAL;
873 g->bios.perf_token, 873 goto done;
874 CONTINUOUS_VIRTUAL_BINNING_TABLE); 874 }
875 if (vfevars_tbl_ptr == NULL) { 875
876 status = -EINVAL; 876 vfevars_tbl_ptr = (u8 *)g->ops.bios.get_perf_table_ptrs(g,
877 goto done; 877 g->bios.perf_token,
878 } 878 CONTINUOUS_VIRTUAL_BINNING_TABLE);
879 if (vfevars_tbl_ptr == NULL) {
880 status = -EINVAL;
881 goto done;
879 } 882 }
880 883
881 memcpy(&vfevars_tbl_header, vfevars_tbl_ptr, 884 memcpy(&vfevars_tbl_header, vfevars_tbl_ptr,