Skip to content

Commit

Permalink
misc: ocxl: use put_device() instead of device_unregister()
Browse files Browse the repository at this point in the history
if device_register() returned an error! Always use put_device()
to give up the reference initialized.

Signed-off-by: Arvind Yadav <[email protected]>
Reviewed-by: Uwe Kleine-König <[email protected]>
Acked-by: Andrew Donnellan <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
ArvindYadavCs authored and gregkh committed Mar 15, 2018
1 parent 5fbe9f3 commit 474cca5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/misc/ocxl/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 474cca5

Please sign in to comment.