Commit 4bc88f63 authored by Ravindran, Madhusudhanan (M.)'s avatar Ravindran, Madhusudhanan (M.) Committed by Greg Kroah-Hartman

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: default avatarMadhusudhanan Ravindran <mravindr@visteon.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 87794575
...@@ -1012,7 +1012,7 @@ static int xlr_net_probe(struct platform_device *pdev) ...@@ -1012,7 +1012,7 @@ static int xlr_net_probe(struct platform_device *pdev)
* Allocate our adapter data structure and attach it to the device. * Allocate our adapter data structure and attach it to the device.
*/ */
adapter = (struct xlr_adapter *) adapter = (struct xlr_adapter *)
devm_kzalloc(&pdev->dev, sizeof(adapter), GFP_KERNEL); devm_kzalloc(&pdev->dev, sizeof(*adapter), GFP_KERNEL);
if (!adapter) { if (!adapter) {
err = -ENOMEM; err = -ENOMEM;
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment