Module Name:    src
Committed By:   tsutsui
Date:           Wed Aug 20 17:48:57 UTC 2014

Modified Files:
        src/sys/arch/sun3/dev: fd.c

Log Message:
Sync with sparc/dev/fd.c rev 1.155.

> Fix panic() on opening fd(4), caused by a wrong pointer passed to memset().

Note sun3 still uses gcc 4.5.4 but also panicked by this old bug,
so probably this problem was triggered by not gcc 4.8 but struct disk
changes (struct disk_geom was added in <sys/disk.h> rev 1.58),
which increased sizeof(struct fd_softc) from 248 bytes to 296 bytes.
(i.e. now struct fd_softc could be allocated in a different pool block,
 probably near the wrong pointer of the struct disklabel)

Anyway, this fix should be pullued up to netbsd-7.
(probably I'm the only user of floppy on sun3 though)


To generate a diff of this commit:
cvs rdiff -u -r1.77 -r1.78 src/sys/arch/sun3/dev/fd.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/arch/sun3/dev/fd.c
diff -u src/sys/arch/sun3/dev/fd.c:1.77 src/sys/arch/sun3/dev/fd.c:1.78
--- src/sys/arch/sun3/dev/fd.c:1.77	Fri Jul 25 08:10:35 2014
+++ src/sys/arch/sun3/dev/fd.c	Wed Aug 20 17:48:57 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: fd.c,v 1.77 2014/07/25 08:10:35 dholland Exp $	*/
+/*	$NetBSD: fd.c,v 1.78 2014/08/20 17:48:57 tsutsui Exp $	*/
 
 /*-
  * Copyright (c) 1990 The Regents of the University of California.
@@ -72,7 +72,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.77 2014/07/25 08:10:35 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fd.c,v 1.78 2014/08/20 17:48:57 tsutsui Exp $");
 
 #include "opt_ddb.h"
 
@@ -1875,7 +1875,7 @@ fdgetdisklabel(dev_t dev)
 	struct cpu_disklabel *clp = fd->sc_dk.dk_cpulabel;
 
 	memset(lp, 0, sizeof(struct disklabel));
-	memset(lp, 0, sizeof(struct cpu_disklabel));
+	memset(clp, 0, sizeof(struct cpu_disklabel));
 
 	lp->d_type = DTYPE_FLOPPY;
 	lp->d_secsize = FDC_BSIZE;

Reply via email to