From: Ravindran, Madhusudhanan (M.) Date: Fri, 13 Mar 2015 13:12:37 +0000 (+0000) Subject: staging: netlogic: allocate right size in devm_kzalloc X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4bc88f63d7af89831fac82b67625f3e19156abba;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git staging: netlogic: allocate right size in devm_kzalloc sizeof when applied to a pointer typed expression gives the size of the pointer. The semantic patch that makes this change is available in scripts/coccinelle/misc/noderef.cocci. Signed-off-by: Madhusudhanan Ravindran Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/netlogic/xlr_net.c b/drivers/staging/netlogic/xlr_net.c index e8aae09d1624..8ae01753b011 100644 --- a/drivers/staging/netlogic/xlr_net.c +++ b/drivers/staging/netlogic/xlr_net.c @@ -1012,7 +1012,7 @@ static int xlr_net_probe(struct platform_device *pdev) * Allocate our adapter data structure and attach it to the device. */ adapter = (struct xlr_adapter *) - devm_kzalloc(&pdev->dev, sizeof(adapter), GFP_KERNEL); + devm_kzalloc(&pdev->dev, sizeof(*adapter), GFP_KERNEL); if (!adapter) { err = -ENOMEM; return err;