Re: [PATCH] Fix SCSI proc oops

From: Torben Mathiasen (torben@kernel.dk)
Date: Sat Oct 14 2000 - 05:12:39 EST


On Sat, Oct 14 2000, David S. Miller wrote:
> Date: Sat, 14 Oct 2000 11:43:09 +0200
> From: Torben Mathiasen <torben@kernel.dk>
>
> David, why is tpnt->proc_name NULL on sparc for devices not
> existing? Every driver has this as part of their tpnt struct, so
> it doesn't matter if the underlying device really exists.
>
> In the mentioned case it would be NULL on all architectures, not just
> Sparc ;-) (it happens on ix86 too, ix86 is different only because it
> does not trap kernel NULL pointer derefences during bootup for some
> odd reason)
>
> Here is what happens:
>
> scsi_register_host()
> tpnt->present = tpnt->detect(tpnt);
> /* tpnt->present is zero since no such adapters were found */
>
> If no hosts are detected the driver is under no obligation to
> initialize the tpnt->proc_name field. For example,
> sym53c8xx.c:sym53c8xx_detect() does not if PCI is not present and this
> is the specific case hit on my SBUS-only workstation :-)
>
> Subsequently scsi_unregister_host() is called for this TPNT and
> this is where the NULL pointer is hit.
>

Ahh, the drivers I looked at all had proc_name as part of their:

define IN2000 {
        bla: bla,
        proc_name: IN2000,

}

structure. I see your point now.

Are there any reason why sym53c8xx and others initialize proc_name only
if an adapter was actually found (or in the sym case, if a pcibus was
found)?

-- 
Torben Mathiasen <tmm@kernel.dk>
Linux ThunderLAN maintainer 
http://tlan.kernel.dk
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Oct 15 2000 - 21:00:27 EST