Module Name:    src
Committed By:   joerg
Date:           Fri Nov 25 13:55:40 UTC 2011

Modified Files:
        src/sys/dev/ata: wd.c

Log Message:
Replace broken memset with M_ZERO


To generate a diff of this commit:
cvs rdiff -u -r1.389 -r1.390 src/sys/dev/ata/wd.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/ata/wd.c
diff -u src/sys/dev/ata/wd.c:1.389 src/sys/dev/ata/wd.c:1.390
--- src/sys/dev/ata/wd.c:1.389	Thu Oct 27 13:07:37 2011
+++ src/sys/dev/ata/wd.c	Fri Nov 25 13:55:40 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: wd.c,v 1.389 2011/10/27 13:07:37 jakllsch Exp $ */
+/*	$NetBSD: wd.c,v 1.390 2011/11/25 13:55:40 joerg Exp $ */
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -54,7 +54,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.389 2011/10/27 13:07:37 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.390 2011/11/25 13:55:40 joerg Exp $");
 
 #include "opt_ata.h"
 
@@ -1276,10 +1276,10 @@ wdioctl(dev_t dev, u_long xfer, void *ad
 
 #ifdef __HAVE_OLD_DISKLABEL
 		if (xfer == ODIOCSDINFO || xfer == ODIOCWDINFO) {
-			newlabel = malloc(sizeof *newlabel, M_TEMP, M_WAITOK);
+			newlabel = malloc(sizeof *newlabel, M_TEMP,
+			    M_WAITOK | M_ZERO);
 			if (newlabel == NULL)
 				return EIO;
-			memset(newlabel, 0, sizeof newlabel);
 			memcpy(newlabel, addr, sizeof (struct olddisklabel));
 			lp = newlabel;
 		} else

Reply via email to