mirror of
https://github.com/torvalds/linux.git
synced 2024-11-28 15:11:31 +00:00
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
This commit is contained in:
parent
4dd3cdb281
commit
968d72e6a5
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user