Skip to content

Commit 968d72e

Browse files
Dan Carpenterdanvet
authored andcommitted
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: Dan Carpenter <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 4dd3cdb commit 968d72e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/savage/savage_state.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,7 @@ int savage_bci_cmdbuf(struct drm_device *dev, void *data, struct drm_file *file_
971971
LOCK_TEST_WITH_RETURN(dev, file_priv);
972972

973973
if (dma && dma->buflist) {
974-
if (cmdbuf->dma_idx > dma->buf_count) {
974+
if (cmdbuf->dma_idx >= dma->buf_count) {
975975
DRM_ERROR
976976
("vertex buffer index %u out of range (0-%u)\n",
977977
cmdbuf->dma_idx, dma->buf_count - 1);

0 commit comments

Comments
 (0)