From owner-svn-src-stable-8@FreeBSD.ORG Sun Dec 13 14:55:51 2009 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D1921065679; Sun, 13 Dec 2009 14:55:51 +0000 (UTC) (envelope-from rnoland@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B78C8FC18; Sun, 13 Dec 2009 14:55:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nBDEtp3v089378; Sun, 13 Dec 2009 14:55:51 GMT (envelope-from rnoland@svn.freebsd.org) Received: (from rnoland@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nBDEtpfG089376; Sun, 13 Dec 2009 14:55:51 GMT (envelope-from rnoland@svn.freebsd.org) Message-Id: <200912131455.nBDEtpfG089376@svn.freebsd.org> From: Robert Noland Date: Sun, 13 Dec 2009 14:55:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r200474 - stable/8/sys/dev/drm X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Dec 2009 14:55:51 -0000 Author: rnoland Date: Sun Dec 13 14:55:50 2009 New Revision: 200474 URL: http://svn.freebsd.org/changeset/base/200474 Log: MFC 198332 Check pointer for NULL before dereferencing it, not after. Originally committed by: brueffer Modified: stable/8/sys/dev/drm/mach64_state.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/drm/mach64_state.c ============================================================================== --- stable/8/sys/dev/drm/mach64_state.c Sun Dec 13 13:57:32 2009 (r200473) +++ stable/8/sys/dev/drm/mach64_state.c Sun Dec 13 14:55:50 2009 (r200474) @@ -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,