Skip to content

Commit

Permalink
gpu/drm/radeon/radeon_irq.c: move a dereference below a NULL test
Browse files Browse the repository at this point in the history
If a NULL value is possible, the dereference should only occur after the
NULL test.

Coverity CID: 13338

Signed-off-by: Darren Jenkins <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
  • Loading branch information
DarrenRJ authored and airlied committed Jan 7, 2010
1 parent 875c186 commit 65aa2f4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions drivers/gpu/drm/radeon/radeon_irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))) {
Expand Down

0 comments on commit 65aa2f4

Please sign in to comment.