LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] RDMA/rtrs: Remove a useless kfree
@ 2021-08-05 17:43 Christophe JAILLET
  2021-08-06 10:09 ` Haris Iqbal
  2021-08-19 14:30 ` Jason Gunthorpe
  0 siblings, 2 replies; 3+ messages in thread
From: Christophe JAILLET @ 2021-08-05 17:43 UTC (permalink / raw)
  To: haris.iqbal, jinpu.wang, dledford, jgg
  Cc: linux-rdma, linux-kernel, kernel-janitors, Christophe JAILLET

'sess->rbufs' is known to be NULL here, so there is no point in kfree'ing
it. It is just a no-op.

Remove the useless kfree.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
 drivers/infiniband/ulp/rtrs/rtrs-clt.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/infiniband/ulp/rtrs/rtrs-clt.c b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
index ece3205531b8..fc440a08e112 100644
--- a/drivers/infiniband/ulp/rtrs/rtrs-clt.c
+++ b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
@@ -1844,7 +1844,6 @@ static int rtrs_rdma_conn_established(struct rtrs_clt_con *con,
 		}
 
 		if (!sess->rbufs) {
-			kfree(sess->rbufs);
 			sess->rbufs = kcalloc(queue_depth, sizeof(*sess->rbufs),
 					      GFP_KERNEL);
 			if (!sess->rbufs)
-- 
2.30.2


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] RDMA/rtrs: Remove a useless kfree
  2021-08-05 17:43 [PATCH] RDMA/rtrs: Remove a useless kfree Christophe JAILLET
@ 2021-08-06 10:09 ` Haris Iqbal
  2021-08-19 14:30 ` Jason Gunthorpe
  1 sibling, 0 replies; 3+ messages in thread
From: Haris Iqbal @ 2021-08-06 10:09 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: Jinpu Wang, Doug Ledford, Jason Gunthorpe, RDMA mailing list,
	linux-kernel, kernel-janitors

On Thu, Aug 5, 2021 at 7:43 PM Christophe JAILLET
<christophe.jaillet@wanadoo.fr> wrote:
>
> 'sess->rbufs' is known to be NULL here, so there is no point in kfree'ing
> it. It is just a no-op.
>
> Remove the useless kfree.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>

Thanks
Acked-by: Md Haris Iqbal <haris.iqbal@ionos.com>

> ---
>  drivers/infiniband/ulp/rtrs/rtrs-clt.c | 1 -
>  1 file changed, 1 deletion(-)
>
> diff --git a/drivers/infiniband/ulp/rtrs/rtrs-clt.c b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
> index ece3205531b8..fc440a08e112 100644
> --- a/drivers/infiniband/ulp/rtrs/rtrs-clt.c
> +++ b/drivers/infiniband/ulp/rtrs/rtrs-clt.c
> @@ -1844,7 +1844,6 @@ static int rtrs_rdma_conn_established(struct rtrs_clt_con *con,
>                 }
>
>                 if (!sess->rbufs) {
> -                       kfree(sess->rbufs);
>                         sess->rbufs = kcalloc(queue_depth, sizeof(*sess->rbufs),
>                                               GFP_KERNEL);
>                         if (!sess->rbufs)
> --
> 2.30.2
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] RDMA/rtrs: Remove a useless kfree
  2021-08-05 17:43 [PATCH] RDMA/rtrs: Remove a useless kfree Christophe JAILLET
  2021-08-06 10:09 ` Haris Iqbal
@ 2021-08-19 14:30 ` Jason Gunthorpe
  1 sibling, 0 replies; 3+ messages in thread
From: Jason Gunthorpe @ 2021-08-19 14:30 UTC (permalink / raw)
  To: Christophe JAILLET
  Cc: haris.iqbal, jinpu.wang, dledford, linux-rdma, linux-kernel,
	kernel-janitors

On Thu, Aug 05, 2021 at 07:43:36PM +0200, Christophe JAILLET wrote:
> 'sess->rbufs' is known to be NULL here, so there is no point in kfree'ing
> it. It is just a no-op.
> 
> Remove the useless kfree.
> 
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> Acked-by: Md Haris Iqbal <haris.iqbal@ionos.com>
> ---
>  drivers/infiniband/ulp/rtrs/rtrs-clt.c | 1 -
>  1 file changed, 1 deletion(-)

Applied to for-next with a Fixes line, thanks

Jason

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-19 14:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-05 17:43 [PATCH] RDMA/rtrs: Remove a useless kfree Christophe JAILLET
2021-08-06 10:09 ` Haris Iqbal
2021-08-19 14:30 ` Jason Gunthorpe

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).