Commit 968d72e6 authored by Dan Carpenter's avatar Dan Carpenter Committed by Daniel Vetter

drm/savage: off by one in savage_bci_cmdbuf()

The > should be >= here so that we don't read beyond the end of the
dma->buflist[] array.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20180704094810.whrgn6jxe7uibnfv@kili.mountain
parent 4dd3cdb2
...@@ -971,7 +971,7 @@ int savage_bci_cmdbuf(struct drm_device *dev, void *data, struct drm_file *file_ ...@@ -971,7 +971,7 @@ int savage_bci_cmdbuf(struct drm_device *dev, void *data, struct drm_file *file_
LOCK_TEST_WITH_RETURN(dev, file_priv); LOCK_TEST_WITH_RETURN(dev, file_priv);
if (dma && dma->buflist) { if (dma && dma->buflist) {
if (cmdbuf->dma_idx > dma->buf_count) { if (cmdbuf->dma_idx >= dma->buf_count) {
DRM_ERROR DRM_ERROR
("vertex buffer index %u out of range (0-%u)\n", ("vertex buffer index %u out of range (0-%u)\n",
cmdbuf->dma_idx, dma->buf_count - 1); cmdbuf->dma_idx, dma->buf_count - 1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment