svn commit: r201068 - stable/8/sys/dev/ips

Matt Jacob mjacob at FreeBSD.org
Sun Dec 27 22:50:26 UTC 2009


Author: mjacob
Date: Sun Dec 27 22:50:25 2009
New Revision: 201068
URL: http://svn.freebsd.org/changeset/base/201068

Log:
  MFC of 198329: Check pointer for NULL before dereferencing it, not after.

Modified:
  stable/8/sys/dev/ips/ips_disk.c

Modified: stable/8/sys/dev/ips/ips_disk.c
==============================================================================
--- stable/8/sys/dev/ips/ips_disk.c	Sun Dec 27 22:49:34 2009	(r201067)
+++ stable/8/sys/dev/ips/ips_disk.c	Sun Dec 27 22:50:25 2009	(r201068)
@@ -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");


More information about the svn-src-stable-8 mailing list