]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
staging: vme: vme_user: Fix some error handling paths in 'vme_user_probe()'
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Tue, 13 Mar 2018 21:01:13 +0000 (22:01 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Mar 2018 14:55:21 +0000 (15:55 +0100)
2 gotos in error handling paths branch to the wrong label.
Fix it.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vme/devices/vme_user.c

index 3242dee8246faa7a141e518dd56990a1032ca274..6a33aaa1a49fb4449be761912107f628b7a8fce4 100644 (file)
@@ -558,7 +558,7 @@ static int vme_user_probe(struct vme_dev *vdev)
        vme_user_cdev->owner = THIS_MODULE;
        err = cdev_add(vme_user_cdev, MKDEV(VME_MAJOR, 0), VME_DEVS);
        if (err)
-               goto err_char;
+               goto err_class;
 
        /* Request slave resources and allocate buffers (128kB wide) */
        for (i = SLAVE_MINOR; i < (SLAVE_MAX + 1); i++) {
@@ -618,7 +618,7 @@ static int vme_user_probe(struct vme_dev *vdev)
        if (IS_ERR(vme_user_sysfs_class)) {
                dev_err(&vdev->dev, "Error creating vme_user class.\n");
                err = PTR_ERR(vme_user_sysfs_class);
-               goto err_class;
+               goto err_master;
        }
 
        /* Add sysfs Entries */