diff options
| -rw-r--r-- | drivers/firewire/core-card.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/firewire/core-card.c b/drivers/firewire/core-card.c index f74edae5cb4c..e4864e894e4f 100644 --- a/drivers/firewire/core-card.c +++ b/drivers/firewire/core-card.c | |||
| @@ -444,16 +444,13 @@ int fw_card_add(struct fw_card *card, | |||
| 444 | card->guid = guid; | 444 | card->guid = guid; |
| 445 | 445 | ||
| 446 | mutex_lock(&card_mutex); | 446 | mutex_lock(&card_mutex); |
| 447 | config_rom = generate_config_rom(card, &length); | ||
| 448 | list_add_tail(&card->link, &card_list); | ||
| 449 | mutex_unlock(&card_mutex); | ||
| 450 | 447 | ||
| 448 | config_rom = generate_config_rom(card, &length); | ||
| 451 | ret = card->driver->enable(card, config_rom, length); | 449 | ret = card->driver->enable(card, config_rom, length); |
| 452 | if (ret < 0) { | 450 | if (ret == 0) |
| 453 | mutex_lock(&card_mutex); | 451 | list_add_tail(&card->link, &card_list); |
| 454 | list_del(&card->link); | 452 | |
| 455 | mutex_unlock(&card_mutex); | 453 | mutex_unlock(&card_mutex); |
| 456 | } | ||
| 457 | 454 | ||
| 458 | return ret; | 455 | return ret; |
| 459 | } | 456 | } |
