summaryrefslogtreecommitdiff
path: root/drivers/staging/ipack
diff options
context:
space:
mode:
authorMiguel Gómez <magomez@igalia.com>2012-06-07 08:24:54 (GMT)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-06-09 15:58:03 (GMT)
commitec0ceb9e42ca9d7c65c1cbea585d8f5d61db7b2f (patch)
tree29b30ec5b3f4c6ac2311e7ff5d7758c23d164f19 /drivers/staging/ipack
parentf7986a9e7341e8f4c69cc36a60e1f778a01471ee (diff)
downloadlinux-fsl-qoriq-ec0ceb9e42ca9d7c65c1cbea585d8f5d61db7b2f.tar.xz
Staging: ipack/bridges/tpci200: remove gotos in tpci200_install()
Remove the gotos when handling error conditions, as the code gets clearer and the gotos are not really avoiding code replication. Signed-off-by: Miguel Gómez <magomez@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/ipack')
-rw-r--r--drivers/staging/ipack/bridges/tpci200.c19
1 files changed, 7 insertions, 12 deletions
diff --git a/drivers/staging/ipack/bridges/tpci200.c b/drivers/staging/ipack/bridges/tpci200.c
index 7616c49..e692f1e 100644
--- a/drivers/staging/ipack/bridges/tpci200.c
+++ b/drivers/staging/ipack/bridges/tpci200.c
@@ -777,23 +777,18 @@ static int tpci200_install(struct tpci200_board *tpci200)
tpci200->slots = kzalloc(
TPCI200_NB_SLOT * sizeof(struct tpci200_slot), GFP_KERNEL);
- if (tpci200->slots == NULL) {
- res = -ENOMEM;
- goto out_err;
- }
+ if (tpci200->slots == NULL)
+ return -ENOMEM;
res = tpci200_register(tpci200);
- if (res)
- goto out_free;
+ if (res) {
+ kfree(tpci200->slots);
+ tpci200->slots = NULL;
+ return res;
+ }
mutex_init(&tpci200->mutex);
return 0;
-
-out_free:
- kfree(tpci200->slots);
- tpci200->slots = NULL;
-out_err:
- return res;
}
static int tpci200_pciprobe(struct pci_dev *pdev,