From: Sudip Mukherjee Date: Mon, 15 Jun 2015 14:35:49 +0000 (+0530) Subject: parport: fix error handling X-Git-Tag: v4.9.8~3849^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cabea695875e3a07313c205a9753c7416126dfa2;p=platform%2Fkernel%2Flinux-rpi3.git 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/parport/share.c b/drivers/parport/share.c index 8067f54..d8079e37 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; }