[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <81eaa48f-2d47-6e4e-9445-356930d974a3@deltatee.com>
Date: Fri, 9 Mar 2018 09:46:54 -0700
From: Logan Gunthorpe <logang@...tatee.com>
To: Arvind Yadav <arvind.yadav.cs@...il.com>, jdmason@...zu.us,
dave.jiang@...el.com, allenbh@...il.com
Cc: linux-kernel@...r.kernel.org, linux-ntb@...glegroups.com
Subject: Re: [PATCH] ntb_transport: use put_device() instead of kfree()
Looks correct to me. Thanks!
Reviewed-by: Logan Gunthorpe <logang@...tatee.com>
On 09/03/18 03:33 AM, Arvind Yadav wrote:
> Never directly free @dev after calling device_register(), even
> if it returned an error! Always use put_device() to give up the
> reference initialized.
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@...il.com>
> ---
> drivers/ntb/ntb_transport.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c
> index 9878c48..8182a3a 100644
> --- a/drivers/ntb/ntb_transport.c
> +++ b/drivers/ntb/ntb_transport.c
> @@ -393,7 +393,7 @@ int ntb_transport_register_client_dev(char *device_name)
>
> rc = device_register(dev);
> if (rc) {
> - kfree(client_dev);
> + put_device(dev);
> goto err;
> }
>
>
Powered by blists - more mailing lists