Skip to content

Commit

Permalink
drm: remove pointless checks in radeon_state
Browse files Browse the repository at this point in the history
If these were valid checks, we'd have already oopsed several
lines above where we were already dereferencing them.

DA: these used to be valid but other changes made them unnecessary.

Coverity: 776,777,778
Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
  • Loading branch information
Dave Airlie committed Mar 19, 2006
1 parent f15e92d commit 2fab58d
Showing 1 changed file with 0 additions and 45 deletions.
45 changes: 0 additions & 45 deletions drivers/char/drm/radeon_state.c
Original file line number Diff line number Diff line change
Expand Up @@ -1970,11 +1970,6 @@ static int radeon_surface_alloc(DRM_IOCTL_ARGS)
drm_radeon_private_t *dev_priv = dev->dev_private;
drm_radeon_surface_alloc_t alloc;

if (!dev_priv) {
DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
return DRM_ERR(EINVAL);
}

DRM_COPY_FROM_USER_IOCTL(alloc,
(drm_radeon_surface_alloc_t __user *) data,
sizeof(alloc));
Expand All @@ -1991,11 +1986,6 @@ static int radeon_surface_free(DRM_IOCTL_ARGS)
drm_radeon_private_t *dev_priv = dev->dev_private;
drm_radeon_surface_free_t memfree;

if (!dev_priv) {
DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
return DRM_ERR(EINVAL);
}

DRM_COPY_FROM_USER_IOCTL(memfree, (drm_radeon_surface_free_t __user *) data,
sizeof(memfree));

Expand Down Expand Up @@ -2131,11 +2121,6 @@ static int radeon_cp_vertex(DRM_IOCTL_ARGS)

LOCK_TEST_WITH_RETURN(dev, filp);

if (!dev_priv) {
DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
return DRM_ERR(EINVAL);
}

DRM_GET_PRIV_WITH_RETURN(filp_priv, filp);

DRM_COPY_FROM_USER_IOCTL(vertex, (drm_radeon_vertex_t __user *) data,
Expand Down Expand Up @@ -2220,11 +2205,6 @@ static int radeon_cp_indices(DRM_IOCTL_ARGS)

LOCK_TEST_WITH_RETURN(dev, filp);

if (!dev_priv) {
DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
return DRM_ERR(EINVAL);
}

DRM_GET_PRIV_WITH_RETURN(filp_priv, filp);

DRM_COPY_FROM_USER_IOCTL(elts, (drm_radeon_indices_t __user *) data,
Expand Down Expand Up @@ -2371,11 +2351,6 @@ static int radeon_cp_indirect(DRM_IOCTL_ARGS)

LOCK_TEST_WITH_RETURN(dev, filp);

if (!dev_priv) {
DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
return DRM_ERR(EINVAL);
}

DRM_COPY_FROM_USER_IOCTL(indirect,
(drm_radeon_indirect_t __user *) data,
sizeof(indirect));
Expand Down Expand Up @@ -2448,11 +2423,6 @@ static int radeon_cp_vertex2(DRM_IOCTL_ARGS)

LOCK_TEST_WITH_RETURN(dev, filp);

if (!dev_priv) {
DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
return DRM_ERR(EINVAL);
}

DRM_GET_PRIV_WITH_RETURN(filp_priv, filp);

DRM_COPY_FROM_USER_IOCTL(vertex, (drm_radeon_vertex2_t __user *) data,
Expand Down Expand Up @@ -2769,11 +2739,6 @@ static int radeon_cp_cmdbuf(DRM_IOCTL_ARGS)

LOCK_TEST_WITH_RETURN(dev, filp);

if (!dev_priv) {
DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
return DRM_ERR(EINVAL);
}

DRM_GET_PRIV_WITH_RETURN(filp_priv, filp);

DRM_COPY_FROM_USER_IOCTL(cmdbuf,
Expand Down Expand Up @@ -2928,11 +2893,6 @@ static int radeon_cp_getparam(DRM_IOCTL_ARGS)
drm_radeon_getparam_t param;
int value;

if (!dev_priv) {
DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
return DRM_ERR(EINVAL);
}

DRM_COPY_FROM_USER_IOCTL(param, (drm_radeon_getparam_t __user *) data,
sizeof(param));

Expand Down Expand Up @@ -3012,11 +2972,6 @@ static int radeon_cp_setparam(DRM_IOCTL_ARGS)
drm_radeon_setparam_t sp;
struct drm_radeon_driver_file_fields *radeon_priv;

if (!dev_priv) {
DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
return DRM_ERR(EINVAL);
}

DRM_GET_PRIV_WITH_RETURN(filp_priv, filp);

DRM_COPY_FROM_USER_IOCTL(sp, (drm_radeon_setparam_t __user *) data,
Expand Down

0 comments on commit 2fab58d

Please sign in to comment.