mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-25 02:52:51 +03:00
gpu: nvgpu: Validate perfmon id count
Add a check against a too big perfmon id count. Bug 200192125 Coverity ID 24285 Change-Id: I9b17081a1ea7243e6b57c0a95c59913cd8daf98b Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1132966
This commit is contained in:
@@ -662,6 +662,10 @@ int gr_gk20a_css_attach(struct gk20a *g,
|
||||
if (!cs_client)
|
||||
return -EINVAL;
|
||||
|
||||
if (!perfmon_count ||
|
||||
perfmon_count > CSS_MAX_PERFMON_IDS - CSS_FIRST_PERFMON_ID)
|
||||
return -EINVAL;
|
||||
|
||||
gr = &g->gr;
|
||||
*cs_client = NULL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user