diff options
author | Darren Jenkins <darrenrjenkins@gmail.com> | 2009-12-30 04:16:35 +0300 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-01-07 06:56:32 +0300 |
commit | 65aa2f4e8d85b6145ef4834f440a63ab68bd7443 (patch) | |
tree | d2434114bc883c355b251a18ba632fc447255dee | |
parent | 875c186620e017e62b773c93e46af21bb704fe6b (diff) | |
download | linux-65aa2f4e8d85b6145ef4834f440a63ab68bd7443.tar.xz |
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>
-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 drm_radeon_irq_emit_t *emit = data; int result; - if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R600) - return -EINVAL; - - LOCK_TEST_WITH_RETURN(dev, file_priv); - if (!dev_priv) { DRM_ERROR("called with no initialization\n"); return -EINVAL; } + if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R600) + return -EINVAL; + + LOCK_TEST_WITH_RETURN(dev, file_priv); + result = radeon_emit_irq(dev); if (DRM_COPY_TO_USER(emit->irq_seq, &result, sizeof(int))) { |