summaryrefslogtreecommitdiff
path: root/shared-core
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2006-03-08 06:03:45 +0000
committerDave Airlie <airlied@linux.ie>2006-03-08 06:03:45 +0000
commitef835973b2f26410f9c9d3abed3b3f4828a716c1 (patch)
tree96e4596b9aa95986bfb81eb4bb998bf60803dde6 /shared-core
parent4436ab86d8c0e1177bbec276c605d133e7c82ff0 (diff)
fix some use before NULL check
Diffstat (limited to 'shared-core')
-rw-r--r--shared-core/radeon_state.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/shared-core/radeon_state.c b/shared-core/radeon_state.c
index 82ec9606..5280b51f 100644
--- a/shared-core/radeon_state.c
+++ b/shared-core/radeon_state.c
@@ -2123,7 +2123,7 @@ static int radeon_cp_vertex(DRM_IOCTL_ARGS)
DRM_DEVICE;
drm_radeon_private_t *dev_priv = dev->dev_private;
drm_file_t *filp_priv;
- drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
+ drm_radeon_sarea_t *sarea_priv;
drm_device_dma_t *dma = dev->dma;
drm_buf_t *buf;
drm_radeon_vertex_t vertex;
@@ -2136,6 +2136,8 @@ static int radeon_cp_vertex(DRM_IOCTL_ARGS)
return DRM_ERR(EINVAL);
}
+ sarea_priv = dev_priv->sarea_priv;
+
DRM_GET_PRIV_WITH_RETURN(filp_priv, filp);
DRM_COPY_FROM_USER_IOCTL(vertex, (drm_radeon_vertex_t __user *) data,
@@ -2211,7 +2213,7 @@ static int radeon_cp_indices(DRM_IOCTL_ARGS)
DRM_DEVICE;
drm_radeon_private_t *dev_priv = dev->dev_private;
drm_file_t *filp_priv;
- drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
+ drm_radeon_sarea_t *sarea_priv;
drm_device_dma_t *dma = dev->dma;
drm_buf_t *buf;
drm_radeon_indices_t elts;
@@ -2224,6 +2226,7 @@ static int radeon_cp_indices(DRM_IOCTL_ARGS)
DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
return DRM_ERR(EINVAL);
}
+ sarea_priv = dev_priv->sarea_priv;
DRM_GET_PRIV_WITH_RETURN(filp_priv, filp);
@@ -2439,7 +2442,7 @@ static int radeon_cp_vertex2(DRM_IOCTL_ARGS)
DRM_DEVICE;
drm_radeon_private_t *dev_priv = dev->dev_private;
drm_file_t *filp_priv;
- drm_radeon_sarea_t *sarea_priv = dev_priv->sarea_priv;
+ drm_radeon_sarea_t *sarea_priv;
drm_device_dma_t *dma = dev->dma;
drm_buf_t *buf;
drm_radeon_vertex2_t vertex;
@@ -2453,6 +2456,8 @@ static int radeon_cp_vertex2(DRM_IOCTL_ARGS)
return DRM_ERR(EINVAL);
}
+ sarea_priv = dev_priv->sarea_priv;
+
DRM_GET_PRIV_WITH_RETURN(filp_priv, filp);
DRM_COPY_FROM_USER_IOCTL(vertex, (drm_radeon_vertex2_t __user *) data,