svn commit: r218440 - projects/graid/head/sys/geom/raid
Alexander Motin
mav at FreeBSD.org
Tue Feb 8 13:24:59 UTC 2011
Author: mav
Date: Tue Feb 8 13:24:59 2011
New Revision: 218440
URL: http://svn.freebsd.org/changeset/base/218440
Log:
Do not try to read freshly allocated memory.
Modified:
projects/graid/head/sys/geom/raid/md_intel.c
Modified: projects/graid/head/sys/geom/raid/md_intel.c
==============================================================================
--- projects/graid/head/sys/geom/raid/md_intel.c Tue Feb 8 13:04:51 2011 (r218439)
+++ projects/graid/head/sys/geom/raid/md_intel.c Tue Feb 8 13:24:59 2011 (r218440)
@@ -374,8 +374,9 @@ intel_meta_read(struct g_consumer *cp)
g_free(buf);
return (NULL);
}
- meta = malloc(meta->config_size, M_MD_INTEL, M_WAITOK);
- memcpy(meta, buf, min(meta->config_size, pp->sectorsize));
+ size = meta->config_size;
+ meta = malloc(size, M_MD_INTEL, M_WAITOK);
+ memcpy(meta, buf, min(size, pp->sectorsize));
g_free(buf);
/* Read all the rest, if needed. */
More information about the svn-src-projects
mailing list