diff options
author | Arvind Yadav | 2018-03-12 17:06:53 +0530 |
---|---|---|
committer | Greg Kroah-Hartman | 2018-03-15 18:12:01 +0100 |
commit | 474cca5fd894de99afc69274e8b25524ae62d7ee (patch) | |
tree | 1ac5e0eb1ac393bc7a6e13457e9e2d9a2d906ff8 /drivers/misc/ocxl | |
parent | 5fbe9f35dfcd83d94ec9bf4f68a9e0d7cc0550b5 (diff) |
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>
Diffstat (limited to 'drivers/misc/ocxl')
-rw-r--r-- | drivers/misc/ocxl/pci.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/ocxl/pci.c b/drivers/misc/ocxl/pci.c index 0051d9ec76cc..21f425472a82 100644 --- a/drivers/misc/ocxl/pci.c +++ b/drivers/misc/ocxl/pci.c @@ -519,7 +519,7 @@ static struct ocxl_fn *init_function(struct pci_dev *dev) rc = device_register(&fn->dev); if (rc) { deconfigure_function(fn); - device_unregister(&fn->dev); + put_device(&fn->dev); return ERR_PTR(rc); } return fn; |