提交 cabea695 编写于 作者: S Sudip Mukherjee 提交者: Greg Kroah-Hartman

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: NSudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 52721d9d
...@@ -907,7 +907,8 @@ parport_register_dev_model(struct parport *port, const char *name, ...@@ -907,7 +907,8 @@ parport_register_dev_model(struct parport *port, const char *name,
spin_unlock(&port->physport->pardevice_lock); spin_unlock(&port->physport->pardevice_lock);
pr_debug("%s: cannot grant exclusive access for device %s\n", pr_debug("%s: cannot grant exclusive access for device %s\n",
port->name, name); port->name, name);
goto err_put_dev; device_unregister(&par_dev->dev);
goto err_put_port;
} }
port->flags |= PARPORT_FLAG_EXCL; port->flags |= PARPORT_FLAG_EXCL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册