Skip to content

Commit

Permalink
drm/savage: off by one in savage_bci_cmdbuf()
Browse files Browse the repository at this point in the history
The > should be >= here so that we don't read 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/20180704094810.whrgn6jxe7uibnfv@kili.mountain
  • Loading branch information
Dan Carpenter authored and Daniel Vetter committed Jul 4, 2018
1 parent 4dd3cdb commit 968d72e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/savage/savage_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

if (dma && dma->buflist) {
if (cmdbuf->dma_idx > dma->buf_count) {
if (cmdbuf->dma_idx >= dma->buf_count) {
DRM_ERROR
("vertex buffer index %u out of range (0-%u)\n",
cmdbuf->dma_idx, dma->buf_count - 1);
Expand Down

0 comments on commit 968d72e

Please sign in to comment.