mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-30 11:04:25 +00:00
firewire: core: Remove card from list of cards when enable fails
Signed-off-by: Petr Vandrovec <petr@vandrovec.name> After a controller initialization failure, addition of another card got stuck due to card_list corruption. Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
This commit is contained in:
parent
1448d7c6a2
commit
b7479febde
1 changed files with 8 additions and 1 deletions
|
@ -412,6 +412,7 @@ fw_card_add(struct fw_card *card,
|
||||||
{
|
{
|
||||||
u32 *config_rom;
|
u32 *config_rom;
|
||||||
size_t length;
|
size_t length;
|
||||||
|
int err;
|
||||||
|
|
||||||
card->max_receive = max_receive;
|
card->max_receive = max_receive;
|
||||||
card->link_speed = link_speed;
|
card->link_speed = link_speed;
|
||||||
|
@ -422,7 +423,13 @@ fw_card_add(struct fw_card *card,
|
||||||
list_add_tail(&card->link, &card_list);
|
list_add_tail(&card->link, &card_list);
|
||||||
mutex_unlock(&card_mutex);
|
mutex_unlock(&card_mutex);
|
||||||
|
|
||||||
return card->driver->enable(card, config_rom, length);
|
err = card->driver->enable(card, config_rom, length);
|
||||||
|
if (err < 0) {
|
||||||
|
mutex_lock(&card_mutex);
|
||||||
|
list_del(&card->link);
|
||||||
|
mutex_unlock(&card_mutex);
|
||||||
|
}
|
||||||
|
return err;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(fw_card_add);
|
EXPORT_SYMBOL(fw_card_add);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue