RDMA/rtrs: Remove a useless kfree()
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Thu, 5 Aug 2021 17:43:36 +0000 (19:43 +0200)
committerJason Gunthorpe <jgg@nvidia.com>
Thu, 19 Aug 2021 14:19:07 +0000 (11:19 -0300)
'sess->rbufs' is known to be NULL here, so there is no point in kfree'ing
it.

Fixes: 6a98d71daea1 ("RDMA/rtrs: client: main functionality")
Link: https://lore.kernel.org/r/9a57c9f837fa2c6f0070578a1bc4840688f62962.1628185335.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Md Haris Iqbal <haris.iqbal@ionos.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
drivers/infiniband/ulp/rtrs/rtrs-clt.c

index ece3205..fc440a0 100644 (file)
@@ -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)