diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2018-07-03 08:30:16 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2018-07-03 09:00:42 -0400 |
commit | a1de8d0a7e2cc79dad6d469901b3b5d4c94c4554 (patch) | |
tree | a43f73f9deb527ea99b3a799fb268a6ecee28685 | |
parent | 64e625cf53539fea4fcc5410d64c619fdbf3d225 (diff) |
drm/i810: off by one in i810_dma_vertex()
If vertex->idx == dma->buf_count then we end up reading one element
beyond the end of the dma->buflist[] array.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20180703123015.kma7v7rwtdy4urce@kili.mountain
-rw-r--r-- | drivers/gpu/drm/i810/i810_dma.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i810/i810_dma.c b/drivers/gpu/drm/i810/i810_dma.c index 576a417690d4..3b378936f575 100644 --- a/drivers/gpu/drm/i810/i810_dma.c +++ b/drivers/gpu/drm/i810/i810_dma.c | |||
@@ -934,7 +934,7 @@ static int i810_dma_vertex(struct drm_device *dev, void *data, | |||
934 | DRM_DEBUG("idx %d used %d discard %d\n", | 934 | DRM_DEBUG("idx %d used %d discard %d\n", |
935 | vertex->idx, vertex->used, vertex->discard); | 935 | vertex->idx, vertex->used, vertex->discard); |
936 | 936 | ||
937 | if (vertex->idx < 0 || vertex->idx > dma->buf_count) | 937 | if (vertex->idx < 0 || vertex->idx >= dma->buf_count) |
938 | return -EINVAL; | 938 | return -EINVAL; |
939 | 939 | ||
940 | i810_dma_dispatch_vertex(dev, | 940 | i810_dma_dispatch_vertex(dev, |