Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/atari/atari Fix PR/54325 (use of dangling pointer).



details:   https://anonhg.NetBSD.org/src/rev/8a2141d06a46
branches:  trunk
changeset: 452342:8a2141d06a46
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Sat Jun 29 03:19:49 2019 +0000

description:
Fix PR/54325 (use of dangling pointer).

diffstat:

 sys/arch/atari/atari/machdep.c |  23 ++++++++++-------------
 1 files changed, 10 insertions(+), 13 deletions(-)

diffs (51 lines):

diff -r f293ea9dcca3 -r 8a2141d06a46 sys/arch/atari/atari/machdep.c
--- a/sys/arch/atari/atari/machdep.c    Sat Jun 29 03:10:51 2019 +0000
+++ b/sys/arch/atari/atari/machdep.c    Sat Jun 29 03:19:49 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.178 2019/06/29 03:10:51 tsutsui Exp $    */
+/*     $NetBSD: machdep.c,v 1.179 2019/06/29 03:19:49 tsutsui Exp $    */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.178 2019/06/29 03:10:51 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.179 2019/06/29 03:19:49 tsutsui Exp $");
 
 #include "opt_ddb.h"
 #include "opt_compat_netbsd.h"
@@ -236,6 +236,8 @@
 identifycpu(void)
 {
        const char *mach, *mmu, *fpu, *cpu;
+       uint32_t pcr;
+       char cputxt[30];
 
        switch (machineid & ATARI_ANYMACH) {
        case ATARI_TT:
@@ -261,17 +263,12 @@
 
        switch (cputype) {
        case CPU_68060:
-               {
-                       uint32_t        pcr;
-                       char            cputxt[30];
-
-                       __asm(".word 0x4e7a,0x0808;"
-                           "movl %%d0,%0" : "=d"(pcr) : : "d0");
-                       snprintf(cputxt, sizeof(cputxt), "68%s060 rev.%d",
-                           pcr & 0x10000 ? "LC/EC" : "", (pcr >> 8) & 0xff);
-                       cpu = cputxt;
-                       mmu = "/MMU";
-               }
+               __asm(".word 0x4e7a,0x0808;"
+                   "movl %%d0,%0" : "=d"(pcr) : : "d0");
+               snprintf(cputxt, sizeof(cputxt), "68%s060 rev.%d",
+                   pcr & 0x10000 ? "LC/EC" : "", (pcr >> 8) & 0xff);
+               cpu = cputxt;
+               mmu = "/MMU";
                break;
        case CPU_68040:
                cpu = "m68040";



Home | Main Index | Thread Index | Old Index