[PATCH] Crash in hostap_cs, CVS head

Pavel Roskin proski
Sat Dec 20 21:00:58 PST 2003


Hello!

I have bought D-Link 650P with Prism3 chipset, but the first problem I
encountered with it turned out to be generic.  I can reproduce it with
working and fully supported () SMC2632W (Prism 2) - a previously working
and fully supported card.

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.

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.

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.

Patch:
===========================
--- driver/modules/hostap_cs.c
+++ driver/modules/hostap_cs.c
@@ -705,8 +705,7 @@ static int prism2_event(event_t event, i
 	case CS_EVENT_CARD_INSERTION:
 		PDEBUG(DEBUG_EXTRA, "%s: CS_EVENT_CARD_INSERTION\n", dev_info);
 		link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
-		if (prism2_config(link))
-			dev->irq = 0;
+		prism2_config(link);
 		break;

 	case CS_EVENT_CARD_REMOVAL:
===========================

-- 
Regards,
Pavel Roskin




More information about the Hostap mailing list