summaryrefslogtreecommitdiff
path: root/sys/arch/hppa/dev
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2010-04-01 22:53:50 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2010-04-01 22:53:50 +0000
commit068a1e92b16f8ed884b9636f60af95543baf77be (patch)
tree1b4cf5ca9d2a1671b4acf190f4e7206a3fd5063f /sys/arch/hppa/dev
parentdb69f0f9498552064385a0102c0d9e480f672b85 (diff)
Avoid null pointer dereference. Pointed out by Nick Hudson; variant on his
diff from NetBSD.
Diffstat (limited to 'sys/arch/hppa/dev')
-rw-r--r--sys/arch/hppa/dev/apic.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/arch/hppa/dev/apic.c b/sys/arch/hppa/dev/apic.c
index 58c48bc62dc..5870a29ec88 100644
--- a/sys/arch/hppa/dev/apic.c
+++ b/sys/arch/hppa/dev/apic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apic.c,v 1.8 2009/08/22 02:54:50 mk Exp $ */
+/* $OpenBSD: apic.c,v 1.9 2010/04/01 22:53:49 kettenis Exp $ */
/*
* Copyright (c) 2005 Michael Shalayeff
@@ -228,6 +228,7 @@ apic_intr(void *v)
struct apic_iv *iv = v;
struct elroy_softc *sc = iv->sc;
volatile struct elroy_regs *r = sc->sc_regs;
+ pci_intr_handle_t ih = iv->ih;
int claimed = 0;
while (iv) {
@@ -242,7 +243,7 @@ apic_intr(void *v)
/* Signal EOI. */
elroy_write32(&r->apic_eoi,
- htole32((31 - APIC_INT_IRQ(iv->ih)) & APIC_ENT0_VEC));
+ htole32((31 - APIC_INT_IRQ(ih)) & APIC_ENT0_VEC));
return (claimed);
}