aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorDave Airlie <airlied@linux.ie>2006-03-19 04:15:41 -0500
committerDave Airlie <airlied@linux.ie>2006-03-19 04:15:41 -0500
commit2fab58d1a18c752887c2b9f6ee7b6997ced4a77a (patch)
treefbf60e73692a2c069dae6dad8ba1379142c38eb0 /drivers/char
parentf15e92d702bba47f451bd5f63e170252c6e1bba2 (diff)
drm: remove pointless checks in radeon_state
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>
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/drm/radeon_state.c45
1 files changed, 0 insertions, 45 deletions
diff --git a/drivers/char/drm/radeon_state.c b/drivers/char/drm/radeon_state.c
index b006b1c5d85..c5b8f774a59 100644
--- a/drivers/char/drm/radeon_state.c
+++ b/drivers/char/drm/radeon_state.c
@@ -1970,11 +1970,6 @@ static int radeon_surface_alloc(DRM_IOCTL_ARGS)
1970 drm_radeon_private_t *dev_priv = dev->dev_private; 1970 drm_radeon_private_t *dev_priv = dev->dev_private;
1971 drm_radeon_surface_alloc_t alloc; 1971 drm_radeon_surface_alloc_t alloc;
1972 1972
1973 if (!dev_priv) {
1974 DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
1975 return DRM_ERR(EINVAL);
1976 }
1977
1978 DRM_COPY_FROM_USER_IOCTL(alloc, 1973 DRM_COPY_FROM_USER_IOCTL(alloc,
1979 (drm_radeon_surface_alloc_t __user *) data, 1974 (drm_radeon_surface_alloc_t __user *) data,
1980 sizeof(alloc)); 1975 sizeof(alloc));
@@ -1991,11 +1986,6 @@ static int radeon_surface_free(DRM_IOCTL_ARGS)
1991 drm_radeon_private_t *dev_priv = dev->dev_private; 1986 drm_radeon_private_t *dev_priv = dev->dev_private;
1992 drm_radeon_surface_free_t memfree; 1987 drm_radeon_surface_free_t memfree;
1993 1988
1994 if (!dev_priv) {
1995 DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
1996 return DRM_ERR(EINVAL);
1997 }
1998
1999 DRM_COPY_FROM_USER_IOCTL(memfree, (drm_radeon_surface_free_t __user *) data, 1989 DRM_COPY_FROM_USER_IOCTL(memfree, (drm_radeon_surface_free_t __user *) data,
2000 sizeof(memfree)); 1990 sizeof(memfree));
2001 1991
@@ -2131,11 +2121,6 @@ static int radeon_cp_vertex(DRM_IOCTL_ARGS)
2131 2121
2132 LOCK_TEST_WITH_RETURN(dev, filp); 2122 LOCK_TEST_WITH_RETURN(dev, filp);
2133 2123
2134 if (!dev_priv) {
2135 DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
2136 return DRM_ERR(EINVAL);
2137 }
2138
2139 DRM_GET_PRIV_WITH_RETURN(filp_priv, filp); 2124 DRM_GET_PRIV_WITH_RETURN(filp_priv, filp);
2140 2125
2141 DRM_COPY_FROM_USER_IOCTL(vertex, (drm_radeon_vertex_t __user *) data, 2126 DRM_COPY_FROM_USER_IOCTL(vertex, (drm_radeon_vertex_t __user *) data,
@@ -2220,11 +2205,6 @@ static int radeon_cp_indices(DRM_IOCTL_ARGS)
2220 2205
2221 LOCK_TEST_WITH_RETURN(dev, filp); 2206 LOCK_TEST_WITH_RETURN(dev, filp);
2222 2207
2223 if (!dev_priv) {
2224 DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
2225 return DRM_ERR(EINVAL);
2226 }
2227
2228 DRM_GET_PRIV_WITH_RETURN(filp_priv, filp); 2208 DRM_GET_PRIV_WITH_RETURN(filp_priv, filp);
2229 2209
2230 DRM_COPY_FROM_USER_IOCTL(elts, (drm_radeon_indices_t __user *) data, 2210 DRM_COPY_FROM_USER_IOCTL(elts, (drm_radeon_indices_t __user *) data,
@@ -2371,11 +2351,6 @@ static int radeon_cp_indirect(DRM_IOCTL_ARGS)
2371 2351
2372 LOCK_TEST_WITH_RETURN(dev, filp); 2352 LOCK_TEST_WITH_RETURN(dev, filp);
2373 2353
2374 if (!dev_priv) {
2375 DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
2376 return DRM_ERR(EINVAL);
2377 }
2378
2379 DRM_COPY_FROM_USER_IOCTL(indirect, 2354 DRM_COPY_FROM_USER_IOCTL(indirect,
2380 (drm_radeon_indirect_t __user *) data, 2355 (drm_radeon_indirect_t __user *) data,
2381 sizeof(indirect)); 2356 sizeof(indirect));
@@ -2448,11 +2423,6 @@ static int radeon_cp_vertex2(DRM_IOCTL_ARGS)
2448 2423
2449 LOCK_TEST_WITH_RETURN(dev, filp); 2424 LOCK_TEST_WITH_RETURN(dev, filp);
2450 2425
2451 if (!dev_priv) {
2452 DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
2453 return DRM_ERR(EINVAL);
2454 }
2455
2456 DRM_GET_PRIV_WITH_RETURN(filp_priv, filp); 2426 DRM_GET_PRIV_WITH_RETURN(filp_priv, filp);
2457 2427
2458 DRM_COPY_FROM_USER_IOCTL(vertex, (drm_radeon_vertex2_t __user *) data, 2428 DRM_COPY_FROM_USER_IOCTL(vertex, (drm_radeon_vertex2_t __user *) data,
@@ -2769,11 +2739,6 @@ static int radeon_cp_cmdbuf(DRM_IOCTL_ARGS)
2769 2739
2770 LOCK_TEST_WITH_RETURN(dev, filp); 2740 LOCK_TEST_WITH_RETURN(dev, filp);
2771 2741
2772 if (!dev_priv) {
2773 DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
2774 return DRM_ERR(EINVAL);
2775 }
2776
2777 DRM_GET_PRIV_WITH_RETURN(filp_priv, filp); 2742 DRM_GET_PRIV_WITH_RETURN(filp_priv, filp);
2778 2743
2779 DRM_COPY_FROM_USER_IOCTL(cmdbuf, 2744 DRM_COPY_FROM_USER_IOCTL(cmdbuf,
@@ -2928,11 +2893,6 @@ static int radeon_cp_getparam(DRM_IOCTL_ARGS)
2928 drm_radeon_getparam_t param; 2893 drm_radeon_getparam_t param;
2929 int value; 2894 int value;
2930 2895
2931 if (!dev_priv) {
2932 DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
2933 return DRM_ERR(EINVAL);
2934 }
2935
2936 DRM_COPY_FROM_USER_IOCTL(param, (drm_radeon_getparam_t __user *) data, 2896 DRM_COPY_FROM_USER_IOCTL(param, (drm_radeon_getparam_t __user *) data,
2937 sizeof(param)); 2897 sizeof(param));
2938 2898
@@ -3012,11 +2972,6 @@ static int radeon_cp_setparam(DRM_IOCTL_ARGS)
3012 drm_radeon_setparam_t sp; 2972 drm_radeon_setparam_t sp;
3013 struct drm_radeon_driver_file_fields *radeon_priv; 2973 struct drm_radeon_driver_file_fields *radeon_priv;
3014 2974
3015 if (!dev_priv) {
3016 DRM_ERROR("%s called with no initialization\n", __FUNCTION__);
3017 return DRM_ERR(EINVAL);
3018 }
3019
3020 DRM_GET_PRIV_WITH_RETURN(filp_priv, filp); 2975 DRM_GET_PRIV_WITH_RETURN(filp_priv, filp);
3021 2976
3022 DRM_COPY_FROM_USER_IOCTL(sp, (drm_radeon_setparam_t __user *) data, 2977 DRM_COPY_FROM_USER_IOCTL(sp, (drm_radeon_setparam_t __user *) data,