Re: [PATCH] Re: 2.4.17 Oops when trying to mount ATAPI CDROM

From: Zwane Mwaikambo (zwane@linux.realnet.co.sz)
Date: Wed Feb 06 2002 - 02:49:12 EST


On Tue, 5 Feb 2002, Bill Davidsen wrote:

> I have two comments on that code, first that it is some of the ugliest
> code I've seen in a while in terms of goto's,

10: You ain't seen nothing...

> the patch adds a goto to avoid duplicating the test for the missing id,
> which really could be made more readable.

I don't see whats so unreadable about it though, its a short function with
just a few possible code paths, (out of interest) could you post what you
have in mind.

> (while I have a flow diagram in front of me), but given the recent
> discussion of path acceptable lately I won't bother. The code really is
> uglier than a hedgehog's asshole, though.

GOTO 10

> MORE IMPORTANT: doesn't this imply that the device id has either been lost
> or not initialized? I haven't finished grepping for calls to this code
> yet, but intuitively I would guess that if we don't have the id all the
> other stuff might be suspect as well.

Indeed, frankly i have no idea how he managed to go on in that state, but
do note his device is horribly broken. This patch doesn't really fix his
case, but adds a (needed) NULL pointer check.

Regards,
        Zwane Mwaikambo

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Feb 07 2002 - 21:00:47 EST