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

Commit 9349f8af authored by Konstantin Khlebnikov's avatar Konstantin Khlebnikov Committed by Greg Kroah-Hartman
Browse files

staging: vme_pio2: fix oops on module unloading



This patch forbids loading vme_pio2 module without specifing "num_bus" parameter.
Otherwise on module unloading pio2_exit() calls vme_unregister_driver() for not
registered pio2_driver.

Signed-off-by: default avatarKonstantin Khlebnikov <khlebnikov@openvz.org>
Cc: Manohar Vanga <manohar.vanga@gmail.com>
Acked-by: default avatarMartyn Welch <martyn.welch@ge.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 6102c48b
Loading
Loading
Loading
Loading
+2 −12
Original line number Original line Diff line number Diff line
@@ -162,11 +162,9 @@ static struct vme_driver pio2_driver = {


static int __init pio2_init(void)
static int __init pio2_init(void)
{
{
	int retval = 0;

	if (bus_num == 0) {
	if (bus_num == 0) {
		pr_err("No cards, skipping registration\n");
		pr_err("No cards, skipping registration\n");
		goto err_nocard;
		return -ENODEV;
	}
	}


	if (bus_num > PIO2_CARDS_MAX) {
	if (bus_num > PIO2_CARDS_MAX) {
@@ -176,15 +174,7 @@ static int __init pio2_init(void)
	}
	}


	/* Register the PIO2 driver */
	/* Register the PIO2 driver */
	retval = vme_register_driver(&pio2_driver, bus_num);
	return  vme_register_driver(&pio2_driver, bus_num);
	if (retval != 0)
		goto err_reg;

	return retval;

err_reg:
err_nocard:
	return retval;
}
}


static int pio2_match(struct vme_dev *vdev)
static int pio2_match(struct vme_dev *vdev)