]> Git Repo - linux.git/commitdiff
drm/savage: off by one in savage_bci_cmdbuf()
authorDan Carpenter <[email protected]>
Wed, 4 Jul 2018 09:48:10 +0000 (12:48 +0300)
committerDaniel Vetter <[email protected]>
Wed, 4 Jul 2018 12:27:01 +0000 (14:27 +0200)
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]
drivers/gpu/drm/savage/savage_state.c

index 2db89bed52e80625bee50917652a41c2dc2a5f8d..7559a820bd435362412ecb4eb76f6bc26735ad95 100644 (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);
 
        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);
This page took 0.058144 seconds and 4 git commands to generate.