Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 Dec 2009 15:08:25 +0000 (UTC)
From:      Robert Noland <rnoland@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r200476 - stable/7/sys/dev/drm
Message-ID:  <200912131508.nBDF8PRh089758@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rnoland
Date: Sun Dec 13 15:08:25 2009
New Revision: 200476
URL: http://svn.freebsd.org/changeset/base/200476

Log:
  MFC 198332
  
  Check pointer for NULL before dereferencing it, not after.
  
  Originally committed by:	brueffer

Modified:
  stable/7/sys/dev/drm/mach64_state.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/drm/mach64_state.c
==============================================================================
--- stable/7/sys/dev/drm/mach64_state.c	Sun Dec 13 15:03:54 2009	(r200475)
+++ stable/7/sys/dev/drm/mach64_state.c	Sun Dec 13 15:08:25 2009	(r200476)
@@ -826,7 +826,7 @@ int mach64_dma_vertex(struct drm_device 
 		      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 
 		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,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200912131508.nBDF8PRh089758>