From f8a615daa1038dee36d8c0f7877781a756c2745a Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Fri, 30 Dec 2011 17:39:11 +0100 Subject: [PATCH] kernel/drm: Move a NULL check to the proper place. --- sys/dev/drm/radeon_cs.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/sys/dev/drm/radeon_cs.c b/sys/dev/drm/radeon_cs.c index e49830df0f..adc1209440 100644 --- a/sys/dev/drm/radeon_cs.c +++ b/sys/dev/drm/radeon_cs.c @@ -142,16 +142,15 @@ int radeon_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *fpriv) long size; int r, i; + if (dev_priv == NULL) { + DRM_ERROR("called with no initialization\n"); + return -EINVAL; + } DRM_SPINLOCK(&dev_priv->cs.cs_mutex); /* set command stream id to 0 which is fake id */ cs_id = 0; cs->cs_id = cs_id; - if (dev_priv == NULL) { - DRM_ERROR("called with no initialization\n"); - DRM_SPINUNLOCK(&dev_priv->cs.cs_mutex); - return -EINVAL; - } if (!cs->num_chunks) { DRM_SPINUNLOCK(&dev_priv->cs.cs_mutex); return 0; -- 2.41.0