octeontx2-pf: Fix sizeof() mismatch
authorColin Ian King <colin.king@canonical.com>
Mon, 2 Nov 2020 13:46:01 +0000 (13:46 +0000)
committerJakub Kicinski <kuba@kernel.org>
Wed, 4 Nov 2020 01:51:56 +0000 (17:51 -0800)
An incorrect sizeof() is being used, sizeof(u64 *) is not correct,
it should be sizeof(*sq->sqb_ptrs).

Addresses-Coverity: ("Sizeof not portable (SIZEOF_MISMATCH)")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20201102134601.698436-1-colin.king@canonical.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c

index fc765e86988e9f3ea6e89ed589d4e620129f5bc2..9f3d6715748efce19f35e2f40b58fb2c705a5689 100644 (file)
@@ -1239,7 +1239,7 @@ int otx2_sq_aura_pool_init(struct otx2_nic *pfvf)
 
                sq = &qset->sq[qidx];
                sq->sqb_count = 0;
-               sq->sqb_ptrs = kcalloc(num_sqbs, sizeof(u64 *), GFP_KERNEL);
+               sq->sqb_ptrs = kcalloc(num_sqbs, sizeof(*sq->sqb_ptrs), GFP_KERNEL);
                if (!sq->sqb_ptrs)
                        return -ENOMEM;