[PATCH] Crash in hostap_cs, CVS head

Jouni Malinen jkmaline
Tue Dec 23 10:39:50 PST 2003


On Sun, Dec 21, 2003 at 12:00:58AM -0500, Pavel Roskin wrote:

> The CVS version of hostap crashes in prism2_event() when trying to assign
> 0 to dev->irq.  The problem is that the CS_EVENT_CARD_INSERTION event
> happens when link->priv is still NULL.

Thanks for reporting this; I haven't noticed so far.

> As I understand it, prism2_config() returns non-zero for a failure, zero
> for success.  I have no idea what that line was supposed to do.  Maybe
> prevent releasing the irq, or prevent using it.  Anyway, I think setting
> dev->irq belongs to prism2_config(), not prism2_event() if it's needed at
> all.

I believe it came from another driver that I used as an example. It
looks bogus anyway, since irq 0 is actually valid and maybe even used
with PC Cards on some platforms. Furthermore, nothing in hostap_cs
actually verifies whether dev->irq is zero.

> It worked before and it's broken now because the devices are allocated in
> the different order.  I believe it should be safe to remove that line.
> It was supposed to affect the failure handling, but now it causes an oops
> even in the case of success.  Releasing the assigned IRQ should not be
> affected.

I replaced that line with a debug message.

-- 
Jouni Malinen                                            PGP id EFC895FA




More information about the Hostap mailing list