Merge from PAO3 -- Quick fix a bug which assign_driver() checks wrong

member variable to find the configuration on new driver allocation.
Correct condition is that card_config and driver are not in use.  Both
of them are cleared in card_removed() (conf->driver->card never be
cleared).

This fix problems `No free configuration for card' on insertion, and
pccardd core dump on removal in condition of the same driver but
different card.

Also this might be emergency measures, complete solution would be made
after Hosokawa-san come back.

Consulted with:	imp
Waiting for:	hosokawa
This commit is contained in:
iwasaki 2000-01-24 13:15:05 +00:00
parent fc4b6f75fd
commit e8eb771c17

View File

@ -348,11 +348,11 @@ assign_driver(struct card *cp)
return (conf);
}
/*
* New driver must be allocated. Find one that matches the
* any configurations not in use.
* New driver must be allocated. Find the first configuration
* not in use.
*/
for (conf = cp->config; conf; conf = conf->next)
if (conf->inuse == 0 && conf->driver->card == 0)
if (conf->inuse == 0 && conf->driver->inuse/*card*/ == 0)
break;
if (conf == 0) {
logmsg("No free configuration for card %s", cp->manuf);