Module Name:    src
Committed By:   martin
Date:           Thu May 30 08:28:13 UTC 2013

Modified Files:
        src/sys/dev: cgd.c

Log Message:
Avoid dereferencing an uninitialized pointer


To generate a diff of this commit:
cvs rdiff -u -r1.80 -r1.81 src/sys/dev/cgd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/cgd.c
diff -u src/sys/dev/cgd.c:1.80 src/sys/dev/cgd.c:1.81
--- src/sys/dev/cgd.c:1.80	Wed May 29 23:25:39 2013
+++ src/sys/dev/cgd.c	Thu May 30 08:28:13 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: cgd.c,v 1.80 2013/05/29 23:25:39 christos Exp $ */
+/* $NetBSD: cgd.c,v 1.81 2013/05/30 08:28:13 martin Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.80 2013/05/29 23:25:39 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.81 2013/05/30 08:28:13 martin Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -747,7 +747,7 @@ cgd_ioctl_clr(struct cgd_softc *cs, stru
 static int
 cgd_ioctl_get(dev_t dev, void *data, struct lwp *l)
 {
-	struct cgd_softc *cs;
+	struct cgd_softc *cs = getcgd_softc(dev);
 	struct cgd_user *cgu;
 	int unit;
 	struct	dk_softc *dksc = &cs->sc_dksc;

Reply via email to