Skip to content

Commit

Permalink
parport: fix error handling
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sudip Mukherjee authored and Greg Kroah-Hartman committed Jul 23, 2015
1 parent 52721d9 commit cabea69
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/parport/share.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit cabea69

Please sign in to comment.