diff options
author | Darren Jenkins <darrenrjenkins@gmail.com> | 2009-12-29 20:16:35 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-01-06 22:56:32 -0500 |
commit | 65aa2f4e8d85b6145ef4834f440a63ab68bd7443 (patch) | |
tree | d2434114bc883c355b251a18ba632fc447255dee /drivers/gpu/drm/radeon/radeon_irq.c | |
parent | 875c186620e017e62b773c93e46af21bb704fe6b (diff) |
gpu/drm/radeon/radeon_irq.c: move a dereference below a NULL test
If a NULL value is possible, the dereference should only occur after the
NULL test.
Coverity CID: 13338
Signed-off-by: Darren Jenkins <darrenrjenkins@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_irq.c')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_irq.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_irq.c b/drivers/gpu/drm/radeon/radeon_irq.c index b79ecc4a7cc4..2f349a300195 100644 --- a/drivers/gpu/drm/radeon/radeon_irq.c +++ b/drivers/gpu/drm/radeon/radeon_irq.c | |||
@@ -289,16 +289,16 @@ int radeon_irq_emit(struct drm_device *dev, void *data, struct drm_file *file_pr | |||
289 | drm_radeon_irq_emit_t *emit = data; | 289 | drm_radeon_irq_emit_t *emit = data; |
290 | int result; | 290 | int result; |
291 | 291 | ||
292 | if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R600) | ||
293 | return -EINVAL; | ||
294 | |||
295 | LOCK_TEST_WITH_RETURN(dev, file_priv); | ||
296 | |||
297 | if (!dev_priv) { | 292 | if (!dev_priv) { |
298 | DRM_ERROR("called with no initialization\n"); | 293 | DRM_ERROR("called with no initialization\n"); |
299 | return -EINVAL; | 294 | return -EINVAL; |
300 | } | 295 | } |
301 | 296 | ||
297 | if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R600) | ||
298 | return -EINVAL; | ||
299 | |||
300 | LOCK_TEST_WITH_RETURN(dev, file_priv); | ||
301 | |||
302 | result = radeon_emit_irq(dev); | 302 | result = radeon_emit_irq(dev); |
303 | 303 | ||
304 | if (DRM_COPY_TO_USER(emit->irq_seq, &result, sizeof(int))) { | 304 | if (DRM_COPY_TO_USER(emit->irq_seq, &result, sizeof(int))) { |