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>
This commit is contained in:
parent
f7986a9e73
commit
ec0ceb9e42
|
@ -777,23 +777,18 @@ static int tpci200_install(struct tpci200_board *tpci200)
|
||||||
|
|
||||||
tpci200->slots = kzalloc(
|
tpci200->slots = kzalloc(
|
||||||
TPCI200_NB_SLOT * sizeof(struct tpci200_slot), GFP_KERNEL);
|
TPCI200_NB_SLOT * sizeof(struct tpci200_slot), GFP_KERNEL);
|
||||||
if (tpci200->slots == NULL) {
|
if (tpci200->slots == NULL)
|
||||||
res = -ENOMEM;
|
return -ENOMEM;
|
||||||
goto out_err;
|
|
||||||
}
|
|
||||||
|
|
||||||
res = tpci200_register(tpci200);
|
res = tpci200_register(tpci200);
|
||||||
if (res)
|
if (res) {
|
||||||
goto out_free;
|
kfree(tpci200->slots);
|
||||||
|
tpci200->slots = NULL;
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
mutex_init(&tpci200->mutex);
|
mutex_init(&tpci200->mutex);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
out_free:
|
|
||||||
kfree(tpci200->slots);
|
|
||||||
tpci200->slots = NULL;
|
|
||||||
out_err:
|
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tpci200_pciprobe(struct pci_dev *pdev,
|
static int tpci200_pciprobe(struct pci_dev *pdev,
|
||||||
|
|
Loading…
Reference in New Issue