From owner-cvs-all Tue May 4 8:43: 6 1999 Delivered-To: cvs-all@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id E7AF615800; Tue, 4 May 1999 08:43:03 -0700 (PDT) (envelope-from wpaul@FreeBSD.org) Received: (from wpaul@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id IAA68719; Tue, 4 May 1999 08:43:03 -0700 (PDT) (envelope-from wpaul@FreeBSD.org) Message-Id: <199905041543.IAA68719@freefall.freebsd.org> From: Bill Paul Date: Tue, 4 May 1999 08:43:03 -0700 (PDT) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/pccard pccard.c Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk wpaul 1999/05/04 08:43:03 PDT Modified files: sys/pccard pccard.c Log: Unbreak slot_irq_handler(). The problem here is that slot_irq_handler() abuses its argument, which is supposed to be an integer unit number, as a pointer to the head of the 'struct slot' list. When this code was hacked^Wupdated for newbus, a new mechanism for registering slot_irq_handler() was put in place and the significance of the unit number was overlooked. When registering an interrupt, we have both device_id and unit. The unit number is passed as 'unit' but /sys/i386/usa/intr_machdep.c:register_intr() drops unit on the floor and uses device_id instead. Since pccard_alloc_intr() always sets device_id to 0, this means the unit number is always zero, and slot_irq_handler() is always called with 0, which becomes a NULL pointer which slot_irq_handler() tries to dereference and the kernel explodes. Result: if you assign a PCMCIA driver in the kernel config file like this: device wi0 at isa? port? irq? Then the system will panic the moment a PCMCIA device is attached and an interrupt is triggered. The quick fix: make pccard_alloc_intr() pass the unit number as both the device_id and unit arguments to register_pcic_intr(). The correct fix would be to rewrite /sys/pccard to be less disgusting. Revision Changes Path 1.78 +2 -2 src/sys/pccard/pccard.c To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message