linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
To: Arvind Yadav <arvind.yadav.cs@gmail.com>,
	sudeep.dutt@intel.com, ashutosh.dixit@intel.com, arnd@arndb.de,
	gregkh@linuxfoundation.org, andrew.donnellan@au1.ibm.com
Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 2/2] misc: ocxl: use put_device() instead of device_unregister()
Date: Tue, 13 Mar 2018 10:38:27 +0100	[thread overview]
Message-ID: <c1b768e0-c5d6-a0bf-f756-6f7bff159bea@linux.vnet.ibm.com> (raw)
In-Reply-To: <8c4d28703e408b71284af68d07c117e7b8c8a75a.1520849284.git.arvind.yadav.cs@gmail.com>



Le 12/03/2018 à 12:36, Arvind Yadav a écrit :
> 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>
> ---

OK, device_unregister() calls put_device() but also other actions that 
we can skip in this case.

Acked-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>


>   drivers/misc/ocxl/pci.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/misc/ocxl/pci.c b/drivers/misc/ocxl/pci.c
> index 0051d9e..21f4254 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;
> 

      parent reply	other threads:[~2018-03-13  9:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-12 11:36 [PATCH 0/2] misc: use put_device() instead of kfree() Arvind Yadav
2018-03-12 11:36 ` [PATCH 1/2] misc: mic: Release reference count and memory for VOP device Arvind Yadav
2018-03-12 11:36 ` [PATCH 2/2] misc: ocxl: use put_device() instead of device_unregister() Arvind Yadav
2018-03-13  0:26   ` Andrew Donnellan
2018-03-13  9:38   ` Frederic Barrat [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c1b768e0-c5d6-a0bf-f756-6f7bff159bea@linux.vnet.ibm.com \
    --to=fbarrat@linux.vnet.ibm.com \
    --cc=andrew.donnellan@au1.ibm.com \
    --cc=arnd@arndb.de \
    --cc=arvind.yadav.cs@gmail.com \
    --cc=ashutosh.dixit@intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=sudeep.dutt@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).