Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Oct 2009 15:04:51 +0000 (UTC)
From:      Christian Brueffer <brueffer@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r198329 - head/sys/dev/ips
Message-ID:  <200910211504.n9LF4pJx002627@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: brueffer
Date: Wed Oct 21 15:04:50 2009
New Revision: 198329
URL: http://svn.freebsd.org/changeset/base/198329

Log:
  Check pointer for NULL before dereferencing it, not after.
  
  PR:		138384
  Submitted by:	Patroklos Argyroudis <argp@census-labs.com>
  MFC after:	1 week

Modified:
  head/sys/dev/ips/ips_disk.c

Modified: head/sys/dev/ips/ips_disk.c
==============================================================================
--- head/sys/dev/ips/ips_disk.c	Wed Oct 21 14:20:55 2009	(r198328)
+++ head/sys/dev/ips/ips_disk.c	Wed Oct 21 15:04:50 2009	(r198329)
@@ -192,10 +192,10 @@ ipsd_dump(void *arg, void *virtual, vm_o
 
 	dp = arg;
 	dsc = dp->d_drv1;
-	sc = dsc->sc;
 
 	if (dsc == NULL)
 		return (EINVAL);
+	sc = dsc->sc;
 
 	if (ips_get_free_cmd(sc, &command, 0) != 0) {
 		printf("ipsd: failed to get cmd for dump\n");



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