summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/pci/drm/radeon_state.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/radeon_state.c b/sys/dev/pci/drm/radeon_state.c
index f53103fd154..2baf3b573c1 100644
--- a/sys/dev/pci/drm/radeon_state.c
+++ b/sys/dev/pci/drm/radeon_state.c
@@ -2110,7 +2110,7 @@ radeon_emit_packets(drm_radeon_private_t * dev_priv, struct drm_file *file_priv,
int sz, reg;
int *data = (int *)cmdbuf->buf;
- if (id >= RADEON_MAX_STATE_PACKETS)
+ if (id < 0 || id >= RADEON_MAX_STATE_PACKETS)
return EINVAL;
sz = packet[id].len;