diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2015-11-03 14:45:16 -0800 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2015-11-03 14:45:16 -0800 |
commit | 84a73014d86fd660822a20c032625e3afe99ca58 (patch) | |
tree | 9e42a2d3c40730947ae18363d00e8a0ee2743792 /drivers/parport | |
parent | 195562194aad3a0a3915941077f283bcc6347b9b (diff) | |
parent | bf5f18d708802737fa0db6306f6b9148f85b2efd (diff) |
Merge branch 'next' into for-linus
Prepare first round of input updates for 4.3 merge window.
Diffstat (limited to 'drivers/parport')
-rw-r--r-- | drivers/parport/share.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/parport/share.c b/drivers/parport/share.c index 8067f54ce050..5ce5ef211bdb 100644 --- a/drivers/parport/share.c +++ b/drivers/parport/share.c @@ -891,8 +891,10 @@ parport_register_dev_model(struct parport *port, const char *name, par_dev->dev.release = free_pardevice; par_dev->devmodel = true; ret = device_register(&par_dev->dev); - if (ret) - goto err_put_dev; + if (ret) { + put_device(&par_dev->dev); + goto err_put_port; + } /* Chain this onto the list */ par_dev->prev = NULL; @@ -907,7 +909,8 @@ parport_register_dev_model(struct parport *port, const char *name, spin_unlock(&port->physport->pardevice_lock); pr_debug("%s: cannot grant exclusive access for device %s\n", port->name, name); - goto err_put_dev; + device_unregister(&par_dev->dev); + goto err_put_port; } port->flags |= PARPORT_FLAG_EXCL; } @@ -938,8 +941,6 @@ parport_register_dev_model(struct parport *port, const char *name, return par_dev; -err_put_dev: - put_device(&par_dev->dev); err_free_devname: kfree(devname); err_free_par_dev: |