Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x86/x86 fix crash when booting with -x.



details:   https://anonhg.NetBSD.org/src/rev/630da3a0ed98
branches:  trunk
changeset: 779191:630da3a0ed98
user:      cegger <cegger%NetBSD.org@localhost>
date:      Wed May 09 13:58:09 2012 +0000

description:
fix crash when booting with -x.

diffstat:

 sys/arch/x86/x86/cpu_ucode_amd.c |  8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diffs (36 lines):

diff -r 1a056d3b313a -r 630da3a0ed98 sys/arch/x86/x86/cpu_ucode_amd.c
--- a/sys/arch/x86/x86/cpu_ucode_amd.c  Wed May 09 12:04:27 2012 +0000
+++ b/sys/arch/x86/x86/cpu_ucode_amd.c  Wed May 09 13:58:09 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cpu_ucode_amd.c,v 1.1 2012/01/13 16:05:15 cegger Exp $ */
+/* $NetBSD: cpu_ucode_amd.c,v 1.2 2012/05/09 13:58:09 cegger Exp $ */
 /*
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cpu_ucode_amd.c,v 1.1 2012/01/13 16:05:15 cegger Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cpu_ucode_amd.c,v 1.2 2012/05/09 13:58:09 cegger Exp $");
 
 #include "opt_xen.h"
 #include "opt_cpu_ucode.h"
@@ -168,7 +168,7 @@
 
                hdr = (struct microcode_amd_header *)mc_amd.mpb;
                if (hdr->ah_processor_rev_id != mc.mc_equiv_cpuid) {
-                       aprint_debug_dev(dev, "ucode: patch does not"
+                       aprint_debug_dev(dev, "ucode: patch does not "
                            "match this cpu "
                            "(patch is for cpu id %x, cpu id is %x)\n",
                            hdr->ah_processor_rev_id, mc.mc_equiv_cpuid);
@@ -196,6 +196,8 @@
                }
 
 next:
+               if (mc.mc_mpbuf == NULL)
+                       break;
                mc.mc_buf += mc.mc_mpbuf->mpb_len +
                    sizeof(mc.mc_mpbuf->mpb_type) +
                    sizeof(mc.mc_mpbuf->mpb_len);



Home | Main Index | Thread Index | Old Index