Skip to contentSkip to conversation

IB/mlx5: Fix wrong use of kfree at bad flow in create_cq_user

PATCH Applied Leon Romanovsky 2 participants 2 messages Mar 29, 2017 – Apr 24, 2017 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 IB/mlx5: Fix wrong use of kfree at bad flow in create_cq_user

From: Bodong Wang <bodong-VPRAkNaXOzVWk0Htik3J/[email protected]>

The kfree was called to free cqb, while it should free *cqb.

Fixes 1cbe6fc86ccf ("IB/mlx5: Add support for CQE compressing")
---
 drivers/infiniband/hw/mlx5/cq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/mlx5/cq.c +1 -1
index 31803b367104..5a31cec947fa 100644
@@ -818,7 +818,7 @@ static int create_cq_user(struct mlx5_ib_dev *dev, struct ib_udata *udata,
 	return 0;
 
 err_cqb:
-	kfree(cqb);
+	kfree(*cqb);
 
 err_db:
 	mlx5_ib_db_unmap_user(to_mucontext(context), &cq->db);

--
2.12.0

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

A message that is not in the archive (sent off-list or not yet received): 20170329031214.6272-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org

Applied
#2 lore raw
Quoted 7 lines · Leon Romanovsky

From: Bodong Wang <bodong-VPRAkNaXOzVWk0Htik3J/[email protected]>

The kfree was called to free cqb, while it should free *cqb.

Fixes 1cbe6fc86ccf ("IB/mlx5: Add support for CQE compressing")

Thanks, applied.

Signature · 9 lines
Doug Ledford <[email protected]>
    GPG KeyID: B826A3330E572FDD
   
Key fingerprint = AE6B 1BDA 122B 23B4 265B  1274 B826 A333 0E57 2FDD

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html