diff options
author | Dan Carpenter <error27@gmail.com> | 2011-07-27 09:53:40 +0000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-08-04 14:22:10 +0100 |
commit | 884988398f43378a170026184648ce8ff14dcc9f (patch) | |
tree | 1c22c0d4ab91633a5893e7d7058ada2b8494b58e /drivers/gpu/drm/radeon/evergreen_cs.c | |
parent | b8709894f248b569d7a0f32cc5e84fa14f7585f0 (diff) |
drm/radeon: off by one in check_reg() functions
This off by one range check was copy and pasted a couple places.
It's not really harmful, but we should fix it anyway.
Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/evergreen_cs.c')
-rw-r--r-- | drivers/gpu/drm/radeon/evergreen_cs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/evergreen_cs.c b/drivers/gpu/drm/radeon/evergreen_cs.c index 189e86522b5b..a134790903d3 100644 --- a/drivers/gpu/drm/radeon/evergreen_cs.c +++ b/drivers/gpu/drm/radeon/evergreen_cs.c @@ -428,7 +428,7 @@ static inline int evergreen_cs_check_reg(struct radeon_cs_parser *p, u32 reg, u3 last_reg = ARRAY_SIZE(evergreen_reg_safe_bm); i = (reg >> 7); - if (i > last_reg) { + if (i >= last_reg) { dev_warn(p->dev, "forbidden register 0x%08x at %d\n", reg, idx); return -EINVAL; } |