diff options
author | Sudip Mukherjee <sudipm.mukherjee@gmail.com> | 2015-06-15 16:35:49 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-07-23 06:15:49 +0200 |
commit | cabea695875e3a07313c205a9753c7416126dfa2 (patch) | |
tree | 67b8e1e70bb322a2353ea6e27b7edec75582ebf3 /drivers/parport | |
parent | Linux 4.2-rc3 (diff) | |
download | linux-cabea695875e3a07313c205a9753c7416126dfa2.tar.xz linux-cabea695875e3a07313c205a9753c7416126dfa2.zip |
parport: fix error handling
After registering the device if exclusive access fails for any reason
then we need to unregister the device to remove all references.
Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/parport')
-rw-r--r-- | drivers/parport/share.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/parport/share.c b/drivers/parport/share.c index 8067f54ce050..d8079e37a606 100644 --- a/drivers/parport/share.c +++ b/drivers/parport/share.c @@ -907,7 +907,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; } |