All of lore.kernel.org
 help / color / mirror / Atom feed
* Coverity: amdgpu_ring_init(): OVERRUN
@ 2020-04-14 15:32 coverity-bot
  0 siblings, 0 replies; only message in thread
From: coverity-bot @ 2020-04-14 15:32 UTC (permalink / raw)
  To: Nirmoy Das
  Cc: Alex Deucher, Christian König, Gustavo A. R. Silva,
	linux-next

Hello!

This is an experimental semi-automated report about issues detected by
Coverity from a scan of next-20200414 as part of the linux-next scan project:
https://scan.coverity.com/projects/linux-next-weekly-scan

You're getting this email because you were associated with the identified
lines of code (noted below) that were touched by commits:

  Wed Apr 1 11:46:57 2020 +0200
    1c6d567bdf73 ("drm/amdgpu: rework sched_list generation")

Coverity reported the following:

*** CID 1492592:    (OVERRUN)
/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c: 266 in amdgpu_ring_init()
260     	ring->priority = DRM_SCHED_PRIORITY_NORMAL;
261     	mutex_init(&ring->priority_mutex);
262
263     	if (!ring->no_scheduler) {
264     		hw_ip = ring->funcs->type;
265     		num_sched = &adev->gpu_sched[hw_ip][hw_prio].num_scheds;
vvv     CID 1492592:    (OVERRUN)
vvv     Overrunning array "adev->gpu_sched" of 9 216-byte elements at element index 9 (byte offset 2159) using index "hw_ip" (which evaluates to 9).
266     		adev->gpu_sched[hw_ip][hw_prio].sched[(*num_sched)++] =
267     			&ring->sched;
268     	}
269
270     	for (i = 0; i < DRM_SCHED_PRIORITY_MAX; ++i)
271     		atomic_set(&ring->num_jobs[i], 0);
/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c: 265 in amdgpu_ring_init()
259     	ring->max_dw = max_dw;
260     	ring->priority = DRM_SCHED_PRIORITY_NORMAL;
261     	mutex_init(&ring->priority_mutex);
262
263     	if (!ring->no_scheduler) {
264     		hw_ip = ring->funcs->type;
vvv     CID 1492592:    (OVERRUN)
vvv     Overrunning array "adev->gpu_sched" of 9 216-byte elements at element index 9 (byte offset 2159) using index "hw_ip" (which evaluates to 9).
265     		num_sched = &adev->gpu_sched[hw_ip][hw_prio].num_scheds;
266     		adev->gpu_sched[hw_ip][hw_prio].sched[(*num_sched)++] =
267     			&ring->sched;
268     	}
269
270     	for (i = 0; i < DRM_SCHED_PRIORITY_MAX; ++i)

If this is a false positive, please let us know so we can mark it as
such, or teach the Coverity rules to be smarter. If not, please make
sure fixes get into linux-next. :) For patches fixing this, please
include these lines (but double-check the "Fixes" first):

Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
Addresses-Coverity-ID: 1492592 ("OVERRUN")
Fixes: 1c6d567bdf73 ("drm/amdgpu: rework sched_list generation")

Thanks for your attention!

-- 
Coverity-bot

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-04-14 15:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-04-14 15:32 Coverity: amdgpu_ring_init(): OVERRUN coverity-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.