diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2018-07-04 12:48:10 +0300 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2018-07-04 15:27:01 +0300 |
commit | 968d72e6a5105a18fe17c0a8b4ef2951d0eb42dd (patch) | |
tree | 85d40a1738372201cfee757e252022772c1047ec /drivers/gpu/drm/savage/savage_state.c | |
parent | 4dd3cdb281f7a3200234ed2bcaae79af15f120d2 (diff) | |
download | linux-968d72e6a5105a18fe17c0a8b4ef2951d0eb42dd.tar.xz |
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 <dan.carpenter@oracle.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20180704094810.whrgn6jxe7uibnfv@kili.mountain
Diffstat (limited to 'drivers/gpu/drm/savage/savage_state.c')
-rw-r--r-- | drivers/gpu/drm/savage/savage_state.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/savage/savage_state.c b/drivers/gpu/drm/savage/savage_state.c index 2db89bed52e8..7559a820bd43 100644 --- a/drivers/gpu/drm/savage/savage_state.c +++ b/drivers/gpu/drm/savage/savage_state.c @@ -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); |