From: Jason Gunthorpe <jgg@nvidia.com>
To: Zheng Yongjun <zhengyongjun3@huawei.com>
Cc: <leon@kernel.org>, <linux-rdma@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <dledford@redhat.com>
Subject: Re: [PATCH v2 -next] infiniband: core: Delete useless kfree code
Date: Thu, 7 Jan 2021 14:30:12 -0400 [thread overview]
Message-ID: <20210107183012.GA909687@nvidia.com> (raw)
In-Reply-To: <20201216080219.18184-1-zhengyongjun3@huawei.com>
On Wed, Dec 16, 2020 at 04:02:19PM +0800, Zheng Yongjun wrote:
> The parameter of kfree function is NULL, so kfree code is useless, delete it.
> Therefore, goto expression is no longer needed, so simplify it.
>
> Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com>
> drivers/infiniband/core/cma_configfs.c | 9 ++-------
> 1 file changed, 2 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/infiniband/core/cma_configfs.c b/drivers/infiniband/core/cma_configfs.c
> index 7ec4af2ed87a..51f59ed6916b 100644
> +++ b/drivers/infiniband/core/cma_configfs.c
> @@ -202,7 +202,6 @@ static int make_cma_ports(struct cma_dev_group *cma_dev_group,
> unsigned int i;
> unsigned int ports_num;
> struct cma_dev_port_group *ports;
> - int err;
>
> ibdev = cma_get_ib_dev(cma_dev);
>
> @@ -214,8 +213,8 @@ static int make_cma_ports(struct cma_dev_group *cma_dev_group,
> GFP_KERNEL);
>
> if (!ports) {
> - err = -ENOMEM;
> - goto free;
> + cma_dev_group->ports = NULL;
This set is also useless, the only caller allocated cma_dev_group with
kzalloc so it is already NULL here, I fixed it and applied to
for-next, thanks
Jason
prev parent reply other threads:[~2021-01-07 18:31 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-16 8:02 [PATCH v2 -next] infiniband: core: Delete useless kfree code Zheng Yongjun
2021-01-07 18:30 ` Jason Gunthorpe [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=20210107183012.GA909687@nvidia.com \
--to=jgg@nvidia.com \
--cc=dledford@redhat.com \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=zhengyongjun3@huawei.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