mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-02 16:44:10 +08:00
misc: ocxl: use put_device() instead of device_unregister()
if device_register() returned an error! Always use put_device() to give up the reference initialized. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
5fbe9f35df
commit
474cca5fd8
@ -519,7 +519,7 @@ static struct ocxl_fn *init_function(struct pci_dev *dev)
|
|||||||
rc = device_register(&fn->dev);
|
rc = device_register(&fn->dev);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
deconfigure_function(fn);
|
deconfigure_function(fn);
|
||||||
device_unregister(&fn->dev);
|
put_device(&fn->dev);
|
||||||
return ERR_PTR(rc);
|
return ERR_PTR(rc);
|
||||||
}
|
}
|
||||||
return fn;
|
return fn;
|
||||||
|
Loading…
Reference in New Issue
Block a user