diff options
author | Jean Delvare <khali@linux-fr.org> | 2006-04-26 16:50:32 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-05-09 16:04:21 -0400 |
commit | 6f9c2963888e60e46a9e0bd09a25740abce29262 (patch) | |
tree | a6f6a310c409fefda006790a77c7ae0d559a33ca | |
parent | e515f048c46e457ef61ce9c8b56bd36e825a48a0 (diff) |
[PATCH] scx200_acb: Fix return on init error
The scx200_acb driver shouldn't return failure after initialization
if it successfully registered at least one i2c_adapter, else we are
leaking resources. The driver was OK in that respect up to 2.6.16, a
recent change broke it.
This is part of the fix to bug #6445.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Ben Gardner <bgardner@wabtec.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/i2c/busses/scx200_acb.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/i2c/busses/scx200_acb.c b/drivers/i2c/busses/scx200_acb.c index 8bd305e47f0d..f2dae6831142 100644 --- a/drivers/i2c/busses/scx200_acb.c +++ b/drivers/i2c/busses/scx200_acb.c | |||
@@ -524,6 +524,9 @@ static int __init scx200_acb_init(void) | |||
524 | } else if (pci_dev_present(divil_pci)) | 524 | } else if (pci_dev_present(divil_pci)) |
525 | rc = scx200_add_cs553x(); | 525 | rc = scx200_add_cs553x(); |
526 | 526 | ||
527 | /* If at least one bus was created, init must succeed */ | ||
528 | if (scx200_acb_list) | ||
529 | return 0; | ||
527 | return rc; | 530 | return rc; |
528 | } | 531 | } |
529 | 532 | ||