Skip to content

Commit

Permalink
qed: fix invalid use of sizeof in qed_alloc_qm_data()
Browse files Browse the repository at this point in the history
sizeof() when applied to a pointer typed expression gives the
size of the pointer, not that of the pointed data.

Fixes: b5a9ee7 ("qed: Revise QM configuration")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Wei Yongjun authored and David S. Miller committed Apr 25, 2017
1 parent 8fe4592 commit 2f7878c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/qlogic/qed/qed_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ static int qed_alloc_qm_data(struct qed_hwfn *p_hwfn)
if (!qm_info->qm_vport_params)
goto alloc_err;

qm_info->qm_port_params = kzalloc(sizeof(qm_info->qm_port_params) *
qm_info->qm_port_params = kzalloc(sizeof(*qm_info->qm_port_params) *
p_hwfn->cdev->num_ports_in_engines,
GFP_KERNEL);
if (!qm_info->qm_port_params)
Expand Down

0 comments on commit 2f7878c

Please sign in to comment.