Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ec0ceb9e authored by Miguel Gómez's avatar Miguel Gómez Committed by Greg Kroah-Hartman
Browse files

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: default avatarMiguel Gómez <magomez@igalia.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f7986a9e
Loading
Loading
Loading
Loading
+7 −12
Original line number Diff line number Diff line
@@ -777,25 +777,20 @@ 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;

	mutex_init(&tpci200->mutex);
	return 0;

out_free:
	if (res) {
		kfree(tpci200->slots);
		tpci200->slots = NULL;
out_err:
		return res;
	}

	mutex_init(&tpci200->mutex);
	return 0;
}

static int tpci200_pciprobe(struct pci_dev *pdev,
			    const struct pci_device_id *id)
{