diff --git a/drivers/gpu/nvgpu/common/regops/regops.c b/drivers/gpu/nvgpu/common/regops/regops.c index 63968618e..8bf190b21 100644 --- a/drivers/gpu/nvgpu/common/regops/regops.c +++ b/drivers/gpu/nvgpu/common/regops/regops.c @@ -1,7 +1,7 @@ /* * Tegra GK20A GPU Debugger Driver Register Ops * - * Copyright (c) 2013-2022, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2013-2023, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -568,7 +568,9 @@ static int profiler_obj_validate_reg_op_offset(struct nvgpu_profiler_object *pro } } #endif - + if (prof->reg_op_type[entry.type] > nvgpu_safe_cast_s32_to_u32(UCHAR_MAX)) { + goto error; + } op->type = (u8)prof->reg_op_type[entry.type]; return 0; diff --git a/drivers/gpu/nvgpu/os/linux/scale.c b/drivers/gpu/nvgpu/os/linux/scale.c index 5170badec..3d2e1347f 100644 --- a/drivers/gpu/nvgpu/os/linux/scale.c +++ b/drivers/gpu/nvgpu/os/linux/scale.c @@ -618,7 +618,7 @@ void gk20a_scale_exit(struct device *dev) struct nvgpu_os_linux *l = nvgpu_os_linux_from_gk20a(g); #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0) struct devfreq *devfreq = l->devfreq; - struct gk20a_scale_profile *profile; + struct gk20a_scale_profile *profile = NULL; #endif int err;