diff options
author | brueffer <brueffer@FreeBSD.org> | 2009-10-21 15:54:45 +0000 |
---|---|---|
committer | brueffer <brueffer@FreeBSD.org> | 2009-10-21 15:54:45 +0000 |
commit | 629bb93ae940a9f77caf2cb815d523fbfcb67d3f (patch) | |
tree | 29e7e4e31c5d90a74d79ecbda7cccb4056f9876a /sys/dev/drm/mach64_state.c | |
parent | edb3a69fdb48a7530641fde8c6100edc2a69ab43 (diff) | |
download | FreeBSD-src-629bb93ae940a9f77caf2cb815d523fbfcb67d3f.zip FreeBSD-src-629bb93ae940a9f77caf2cb815d523fbfcb67d3f.tar.gz |
Check pointer for NULL before dereferencing it, not after.
PR: 138383
Submitted by: Patroklos Argyroudis <argp@census-labs.com>
Reviewed by: rnoland
MFC after: 1 week
Diffstat (limited to 'sys/dev/drm/mach64_state.c')
-rw-r--r-- | sys/dev/drm/mach64_state.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/dev/drm/mach64_state.c b/sys/dev/drm/mach64_state.c index d59d55e..16848c2 100644 --- a/sys/dev/drm/mach64_state.c +++ b/sys/dev/drm/mach64_state.c @@ -826,7 +826,7 @@ int mach64_dma_vertex(struct drm_device *dev, void *data, struct drm_file *file_priv) { drm_mach64_private_t *dev_priv = dev->dev_private; - drm_mach64_sarea_t *sarea_priv = dev_priv->sarea_priv; + drm_mach64_sarea_t *sarea_priv; drm_mach64_vertex_t *vertex = data; LOCK_TEST_WITH_RETURN(dev, file_priv); @@ -835,6 +835,7 @@ int mach64_dma_vertex(struct drm_device *dev, void *data, DRM_ERROR("called with no initialization\n"); return -EINVAL; } + sarea_priv = dev_priv->sarea_priv; DRM_DEBUG("pid=%d buf=%p used=%lu discard=%d\n", DRM_CURRENTPID, |