From: Wei Yongjun Date: Tue, 25 Apr 2017 07:07:18 +0000 (+0000) Subject: qed: fix invalid use of sizeof in qed_alloc_qm_data() X-Git-Tag: v4.1.12-111.0.20170918_2215~134 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=277e8026c2ba711b5e2944b35c8173af5699f8bd;p=users%2Fjedix%2Flinux-maple.git qed: fix invalid use of sizeof in qed_alloc_qm_data() Orabug: 26783820 sizeof() when applied to a pointer typed expression gives the size of the pointer, not that of the pointed data. Fixes: b5a9ee7cf3be ("qed: Revise QM configuration") Signed-off-by: Wei Yongjun Acked-by: Yuval Mintz Signed-off-by: David S. Miller [ Upstream commit 2f7878c06e2d227aa5c405ddde356403b83e3509 ] Signed-off-by: Somasundaram Krishnasamy --- diff --git a/drivers/net/ethernet/qlogic/qed/qed_dev.c b/drivers/net/ethernet/qlogic/qed/qed_dev.c index 01d224d39c200..081843958076a 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_dev.c +++ b/drivers/net/ethernet/qlogic/qed/qed_dev.c @@ -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)