summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gm20b/acr_gm20b.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/gm20b/acr_gm20b.c')
-rw-r--r--drivers/gpu/nvgpu/gm20b/acr_gm20b.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/gm20b/acr_gm20b.c b/drivers/gpu/nvgpu/gm20b/acr_gm20b.c
index 62d3a8fa..c57fba45 100644
--- a/drivers/gpu/nvgpu/gm20b/acr_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/acr_gm20b.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2015-2017, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2015-2018, 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"),
@@ -138,7 +138,8 @@ static int pmu_ucode_details(struct gk20a *g, struct flcn_ucode_img *p_img)
138 err = -ENOMEM; 138 err = -ENOMEM;
139 goto release_sig; 139 goto release_sig;
140 } 140 }
141 memcpy(lsf_desc, (void *)pmu_sig->data, sizeof(struct lsf_ucode_desc)); 141 memcpy(lsf_desc, (void *)pmu_sig->data,
142 min_t(size_t, sizeof(*lsf_desc), pmu_sig->size));
142 lsf_desc->falcon_id = LSF_FALCON_ID_PMU; 143 lsf_desc->falcon_id = LSF_FALCON_ID_PMU;
143 144
144 p_img->desc = pmu->desc; 145 p_img->desc = pmu->desc;
@@ -177,7 +178,8 @@ static int fecs_ucode_details(struct gk20a *g, struct flcn_ucode_img *p_img)
177 err = -ENOMEM; 178 err = -ENOMEM;
178 goto rel_sig; 179 goto rel_sig;
179 } 180 }
180 memcpy(lsf_desc, (void *)fecs_sig->data, sizeof(struct lsf_ucode_desc)); 181 memcpy(lsf_desc, (void *)fecs_sig->data,
182 min_t(size_t, sizeof(*lsf_desc), fecs_sig->size));
181 lsf_desc->falcon_id = LSF_FALCON_ID_FECS; 183 lsf_desc->falcon_id = LSF_FALCON_ID_FECS;
182 184
183 p_img->desc = nvgpu_kzalloc(g, sizeof(struct pmu_ucode_desc)); 185 p_img->desc = nvgpu_kzalloc(g, sizeof(struct pmu_ucode_desc));
@@ -248,7 +250,7 @@ static int gpccs_ucode_details(struct gk20a *g, struct flcn_ucode_img *p_img)
248 goto rel_sig; 250 goto rel_sig;
249 } 251 }
250 memcpy(lsf_desc, (void *)gpccs_sig->data, 252 memcpy(lsf_desc, (void *)gpccs_sig->data,
251 sizeof(struct lsf_ucode_desc)); 253 min_t(size_t, sizeof(*lsf_desc), gpccs_sig->size));
252 lsf_desc->falcon_id = LSF_FALCON_ID_GPCCS; 254 lsf_desc->falcon_id = LSF_FALCON_ID_GPCCS;
253 255
254 p_img->desc = nvgpu_kzalloc(g, sizeof(struct pmu_ucode_desc)); 256 p_img->desc = nvgpu_kzalloc(g, sizeof(struct pmu_ucode_desc));