diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-02-06 08:48:16 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-02-06 08:48:16 -0800 |
commit | 5e3bd4e4b1082e406351083784e3de4cdaa50d7a (patch) | |
tree | 9fdc50af3999e9e978f7df05088a0b8bc8421706 /drivers/firewire/fw-card.c | |
parent | bcee402e764ccbdb507fe56936230af7cb57c813 (diff) | |
parent | 86431532ec4311dccd0d7513cebae6ffc762756b (diff) | |
download | kernel-crypto-5e3bd4e4b1082e406351083784e3de4cdaa50d7a.tar.gz kernel-crypto-5e3bd4e4b1082e406351083784e3de4cdaa50d7a.tar.xz kernel-crypto-5e3bd4e4b1082e406351083784e3de4cdaa50d7a.zip |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6:
ieee1394: dv1394: move deprecation message from module init to file open
firewire: core: Remove card from list of cards when enable fails
Diffstat (limited to 'drivers/firewire/fw-card.c')
-rw-r--r-- | drivers/firewire/fw-card.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/firewire/fw-card.c b/drivers/firewire/fw-card.c index 7be2cf3514e..a5dd7a665aa 100644 --- a/drivers/firewire/fw-card.c +++ b/drivers/firewire/fw-card.c @@ -412,6 +412,7 @@ fw_card_add(struct fw_card *card, { u32 *config_rom; size_t length; + int err; card->max_receive = max_receive; card->link_speed = link_speed; @@ -422,7 +423,13 @@ fw_card_add(struct fw_card *card, list_add_tail(&card->link, &card_list); 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); |