treewide: Use array_size() in vzalloc()
[linux-block.git] / drivers / net / ethernet / huawei / hinic / hinic_hw_cmdq.c
index 28a81ac97af5d27bdb51be136df095db9f5799bf..4d09ea786b35fee607ecb6ea45b148458b98e374 100644 (file)
@@ -753,11 +753,12 @@ static int init_cmdq(struct hinic_cmdq *cmdq, struct hinic_wq *wq,
 
        spin_lock_init(&cmdq->cmdq_lock);
 
-       cmdq->done = vzalloc(wq->q_depth * sizeof(*cmdq->done));
+       cmdq->done = vzalloc(array_size(sizeof(*cmdq->done), wq->q_depth));
        if (!cmdq->done)
                return -ENOMEM;
 
-       cmdq->errcode = vzalloc(wq->q_depth * sizeof(*cmdq->errcode));
+       cmdq->errcode = vzalloc(array_size(sizeof(*cmdq->errcode),
+                                          wq->q_depth));
        if (!cmdq->errcode) {
                err = -ENOMEM;
                goto err_errcode;