From: Wu Fengguang Date: Thu, 3 Mar 2016 01:55:19 +0000 (+0800) Subject: stmmac: fix noderef.cocci warnings X-Git-Tag: v5.15~13995^2~127 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4c3e962df044c34d25403f8f58ff7b34c4966b4a;p=platform%2Fkernel%2Flinux-starfive.git stmmac: fix noderef.cocci warnings drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c:115:15-21: ERROR: application of sizeof to pointer sizeof when applied to a pointer typed expression gives the size of the pointer Generated by: scripts/coccinelle/misc/noderef.cocci CC: Giuseppe Cavallaro Signed-off-by: Fengguang Wu Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c index 69ccf48..9cf181f 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c @@ -112,7 +112,7 @@ static struct stmmac_axi *stmmac_axi_setup(struct platform_device *pdev) if (!np) return NULL; - axi = kzalloc(sizeof(axi), GFP_KERNEL); + axi = kzalloc(sizeof(*axi), GFP_KERNEL); if (!axi) return ERR_PTR(-ENOMEM);