Author: mjg
Date: Wed Oct 23 01:34:18 2013
New Revision: 256951
URL: http://svnweb.freebsd.org/changeset/base/256951

Log:
  gnop: make sure that newly allocated memory for softc is zeroed
  
  This prevents mtx_init from encountering non-zeros and panicking
  the kernel as a result.
  
  Reported by:  Keith White <kwhite site.uottawa.ca>

Modified:
  head/sys/geom/nop/g_nop.c

Modified: head/sys/geom/nop/g_nop.c
==============================================================================
--- head/sys/geom/nop/g_nop.c   Wed Oct 23 00:43:22 2013        (r256950)
+++ head/sys/geom/nop/g_nop.c   Wed Oct 23 01:34:18 2013        (r256951)
@@ -216,7 +216,7 @@ g_nop_create(struct gctl_req *req, struc
                }
        }
        gp = g_new_geomf(mp, "%s", name);
-       sc = g_malloc(sizeof(*sc), M_WAITOK);
+       sc = g_malloc(sizeof(*sc), M_WAITOK | M_ZERO);
        sc->sc_offset = offset;
        sc->sc_explicitsize = explicitsize;
        sc->sc_error = ioerror;
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to