ath11k: Use kcalloc() instead of kzalloc()
authorGustavo A. R. Silva <gustavoars@kernel.org>
Thu, 7 Oct 2021 15:16:24 +0000 (18:16 +0300)
committerKalle Valo <kvalo@codeaurora.org>
Mon, 11 Oct 2021 06:25:08 +0000 (09:25 +0300)
Use 2-factor multiplication argument form kcalloc() instead
of kzalloc().

Link: https://github.com/KSPP/linux/issues/162
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20211006181204.GA913553@embeddedor
drivers/net/wireless/ath/ath11k/wmi.c

index 2d0acfb..8961c35 100644 (file)
@@ -4065,8 +4065,8 @@ static int ath11k_wmi_tlv_mac_phy_caps_parse(struct ath11k_base *soc,
 
        len = min_t(u16, len, sizeof(struct wmi_mac_phy_capabilities));
        if (!svc_rdy_ext->n_mac_phy_caps) {
-               svc_rdy_ext->mac_phy_caps = kzalloc((svc_rdy_ext->tot_phy_id) * len,
-                                                   GFP_ATOMIC);
+               svc_rdy_ext->mac_phy_caps = kcalloc(svc_rdy_ext->tot_phy_id,
+                                                   len, GFP_ATOMIC);
                if (!svc_rdy_ext->mac_phy_caps)
                        return -ENOMEM;
        }
@@ -4466,8 +4466,8 @@ static struct cur_reg_rule
        struct cur_reg_rule *reg_rule_ptr;
        u32 count;
 
-       reg_rule_ptr =  kzalloc((num_reg_rules * sizeof(*reg_rule_ptr)),
-                               GFP_ATOMIC);
+       reg_rule_ptr = kcalloc(num_reg_rules, sizeof(*reg_rule_ptr),
+                              GFP_ATOMIC);
 
        if (!reg_rule_ptr)
                return NULL;