Patch "RDMA/mlx5: Fix type warning of sizeof in __mlx5_ib_alloc_counters()" has been added to the 5.9-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    RDMA/mlx5: Fix type warning of sizeof in __mlx5_ib_alloc_counters()

to the 5.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     rdma-mlx5-fix-type-warning-of-sizeof-in-__mlx5_ib_al.patch
and it can be found in the queue-5.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit a6a197a72f63473bc26cf71044fa1d80062cdad3
Author: Liu Shixin <liushixin2@xxxxxxxxxx>
Date:   Thu Sep 17 16:13:54 2020 +0800

    RDMA/mlx5: Fix type warning of sizeof in __mlx5_ib_alloc_counters()
    
    [ Upstream commit b942fc0319a72b83146b79619eb578e989062911 ]
    
    sizeof() when applied to a pointer typed expression should give the size
    of the pointed data, even if the data is a pointer.
    
    Fixes: e1f24a79f424 ("IB/mlx5: Support congestion related counters")
    Link: https://lore.kernel.org/r/20200917081354.2083293-1-liushixin2@xxxxxxxxxx
    Signed-off-by: Liu Shixin <liushixin2@xxxxxxxxxx>
    Acked-by: Leon Romanovsky <leonro@xxxxxxxxxx>
    Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/infiniband/hw/mlx5/counters.c b/drivers/infiniband/hw/mlx5/counters.c
index 145f3cb40ccba..aeeb14ecb3ee7 100644
--- a/drivers/infiniband/hw/mlx5/counters.c
+++ b/drivers/infiniband/hw/mlx5/counters.c
@@ -456,12 +456,12 @@ static int __mlx5_ib_alloc_counters(struct mlx5_ib_dev *dev,
 		cnts->num_ext_ppcnt_counters = ARRAY_SIZE(ext_ppcnt_cnts);
 		num_counters += ARRAY_SIZE(ext_ppcnt_cnts);
 	}
-	cnts->names = kcalloc(num_counters, sizeof(cnts->names), GFP_KERNEL);
+	cnts->names = kcalloc(num_counters, sizeof(*cnts->names), GFP_KERNEL);
 	if (!cnts->names)
 		return -ENOMEM;
 
 	cnts->offsets = kcalloc(num_counters,
-				sizeof(cnts->offsets), GFP_KERNEL);
+				sizeof(*cnts->offsets), GFP_KERNEL);
 	if (!cnts->offsets)
 		goto err_names;
 



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux