[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20201215075317.GM5005@unreal>
Date: Tue, 15 Dec 2020 09:53:17 +0200
From: Leon Romanovsky <leon@...nel.org>
To: Zheng Yongjun <zhengyongjun3@...wei.com>
Cc: linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH -next] infiniband: core: Delete useless kfree code
On Mon, Dec 14, 2020 at 09:46:55PM +0800, Zheng Yongjun wrote:
> The parameter of kfree function is NULL, so kfree code is useless, delete it.
>
> Signed-off-by: Zheng Yongjun <zhengyongjun3@...wei.com>
> ---
> drivers/infiniband/core/cma_configfs.c | 1 -
> 1 file changed, 1 deletion(-)
The best thing will be to delete whole "free:" section and return
an error immediately.
Thanks
>
> diff --git a/drivers/infiniband/core/cma_configfs.c b/drivers/infiniband/core/cma_configfs.c
> index 7ec4af2ed87a..c6e7cd9bc25a 100644
> --- a/drivers/infiniband/core/cma_configfs.c
> +++ b/drivers/infiniband/core/cma_configfs.c
> @@ -235,7 +235,6 @@ static int make_cma_ports(struct cma_dev_group *cma_dev_group,
>
> return 0;
> free:
> - kfree(ports);
> cma_dev_group->ports = NULL;
> return err;
> }
> --
> 2.22.0
>
Powered by blists - more mailing lists