patch-2.4.6 linux/drivers/char/drm/mga_state.c

Next file: linux/drivers/char/drm/proc.c
Previous file: linux/drivers/char/drm/i810_dma.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.5/linux/drivers/char/drm/mga_state.c linux/drivers/char/drm/mga_state.c
@@ -832,6 +832,7 @@
 		return -EINVAL;
 	}
 
+	if(iload.idx < 0 || iload.idx > dma->buf_count) return -EINVAL;
 	buf = dma->buflist[iload.idx];
 	buf_priv = buf->dev_private;
 	bus_address = buf->bus_address;
@@ -874,6 +875,8 @@
 		return -EINVAL;
 	}
 
+	if(vertex.idx < 0 || vertex.idx > dma->buf_count) return -EINVAL;
+
 	buf = dma->buflist[vertex.idx];
 	buf_priv = buf->dev_private;
 
@@ -920,6 +923,7 @@
 		return -EINVAL;
 	}
 
+	if(indices.idx < 0 || indices.idx > dma->buf_count) return -EINVAL;
 	buf = dma->buflist[indices.idx];
 	buf_priv = buf->dev_private;
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)