Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sun3/dev Sync with sparc/dev/fd.c rev 1.155.



details:   https://anonhg.NetBSD.org/src/rev/fefe7cd53b77
branches:  trunk
changeset: 801849:fefe7cd53b77
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Wed Aug 20 17:48:57 2014 +0000

description:
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)

diffstat:

 sys/arch/sun3/dev/fd.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r a890a706f683 -r fefe7cd53b77 sys/arch/sun3/dev/fd.c
--- a/sys/arch/sun3/dev/fd.c    Wed Aug 20 16:05:03 2014 +0000
+++ b/sys/arch/sun3/dev/fd.c    Wed Aug 20 17:48:57 2014 +0000
@@ -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 @@
        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;



Home | Main Index | Thread Index | Old Index