summaryrefslogtreecommitdiffstats
path: root/drivers/firewire/core-card.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-09-23 09:43:22 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2009-09-23 09:43:22 -0700
commitff830b8e5f999d1ccbd0282a666520f0b557daa4 (patch)
tree5979aba5ed48c93d658a208f3a1f714e9e1e8b67 /drivers/firewire/core-card.c
parent746942d06acdb4dd78d16baa5f3728a48a033bdd (diff)
parent625f0850a8e27b6a8d6fdb95056f35bc22d92b55 (diff)
downloadop-kernel-dev-ff830b8e5f999d1ccbd0282a666520f0b557daa4.zip
op-kernel-dev-ff830b8e5f999d1ccbd0282a666520f0b557daa4.tar.gz
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: sbp2: remove a workaround for Momobay FX-3A firewire: sbp2: remove a workaround for Momobay FX-3A firewire: sbp2: fix status reception firewire: core: fix topology map response handler firewire: core: fix race with parallel PCI device probe firewire: core: header file cleanup firewire: ohci: fix Self ID Count register mask (safeguard against buffer overflow) ieee1394: raw1394: Do not leak memory on failed trylock.
Diffstat (limited to 'drivers/firewire/core-card.c')
-rw-r--r--drivers/firewire/core-card.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/firewire/core-card.c b/drivers/firewire/core-card.c
index f74edae..e4864e8 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,
card->guid = guid;
mutex_lock(&card_mutex);
- config_rom = generate_config_rom(card, &length);
- list_add_tail(&card->link, &card_list);
- mutex_unlock(&card_mutex);
+ config_rom = generate_config_rom(card, &length);
ret = card->driver->enable(card, config_rom, length);
- if (ret < 0) {
- mutex_lock(&card_mutex);
- list_del(&card->link);
- mutex_unlock(&card_mutex);
- }
+ if (ret == 0)
+ list_add_tail(&card->link, &card_list);
+
+ mutex_unlock(&card_mutex);
return ret;
}
OpenPOWER on IntegriCloud