diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/clk/clk_prog.c | 4 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/os/linux/scale.c | 4 |
3 files changed, 8 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/clk/clk_prog.c b/drivers/gpu/nvgpu/clk/clk_prog.c index e5c2a295..9d44d6d4 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) 2016-2018, NVIDIA CORPORATION. All rights reserved. | 2 | * Copyright (c) 2016-2020, NVIDIA CORPORATION. All rights reserved. |
3 | * | 3 | * |
4 | * Permission is hereby granted, free of charge, to any person obtaining a | 4 | * Permission is hereby granted, free of charge, to any person obtaining a |
5 | * copy of this software and associated documentation files (the "Software"), | 5 | * copy of this software and associated documentation files (the "Software"), |
@@ -628,6 +628,8 @@ static int clk_prog_construct_1x_master(struct gk20a *g, | |||
628 | 628 | ||
629 | pclkprog->p_vf_entries = (struct ctrl_clk_clk_prog_1x_master_vf_entry *) | 629 | pclkprog->p_vf_entries = (struct ctrl_clk_clk_prog_1x_master_vf_entry *) |
630 | nvgpu_kzalloc(g, vfsize); | 630 | nvgpu_kzalloc(g, vfsize); |
631 | if (!pclkprog->p_vf_entries) | ||
632 | return -ENOMEM; | ||
631 | 633 | ||
632 | memcpy(pclkprog->p_vf_entries, ptmpprog->p_vf_entries, vfsize); | 634 | memcpy(pclkprog->p_vf_entries, ptmpprog->p_vf_entries, vfsize); |
633 | 635 | ||
diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 4f897b97..d24b8bf7 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c | |||
@@ -3473,6 +3473,8 @@ static int gr_gk20a_init_gr_config(struct gk20a *g, struct gr_gk20a *gr) | |||
3473 | gr->sm_to_cluster = nvgpu_kzalloc(g, gr->gpc_count * | 3473 | gr->sm_to_cluster = nvgpu_kzalloc(g, gr->gpc_count * |
3474 | gr->max_tpc_per_gpc_count * | 3474 | gr->max_tpc_per_gpc_count * |
3475 | sm_per_tpc * sizeof(struct sm_info)); | 3475 | sm_per_tpc * sizeof(struct sm_info)); |
3476 | if (!gr->sm_to_cluster) | ||
3477 | goto clean_up; | ||
3476 | } else { | 3478 | } else { |
3477 | memset(gr->sm_to_cluster, 0, gr->gpc_count * | 3479 | memset(gr->sm_to_cluster, 0, gr->gpc_count * |
3478 | gr->max_tpc_per_gpc_count * | 3480 | gr->max_tpc_per_gpc_count * |
diff --git a/drivers/gpu/nvgpu/os/linux/scale.c b/drivers/gpu/nvgpu/os/linux/scale.c index ef7996e6..388e168d 100644 --- a/drivers/gpu/nvgpu/os/linux/scale.c +++ b/drivers/gpu/nvgpu/os/linux/scale.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * gk20a clock scaling profile | 2 | * gk20a clock scaling profile |
3 | * | 3 | * |
4 | * Copyright (c) 2013-2018, NVIDIA Corporation. All rights reserved. | 4 | * Copyright (c) 2013-2020, NVIDIA Corporation. All rights reserved. |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms and conditions of the GNU General Public License, | 7 | * under the terms and conditions of the GNU General Public License, |
@@ -339,6 +339,8 @@ void gk20a_scale_init(struct device *dev) | |||
339 | return; | 339 | return; |
340 | 340 | ||
341 | profile = nvgpu_kzalloc(g, sizeof(*profile)); | 341 | profile = nvgpu_kzalloc(g, sizeof(*profile)); |
342 | if (!profile) | ||
343 | return; | ||
342 | 344 | ||
343 | profile->dev = dev; | 345 | profile->dev = dev; |
344 | profile->dev_stat.busy = false; | 346 | profile->dev_stat.busy = false; |