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 <mravindr@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Ravindran, Madhusudhanan (M.) 2015-03-13 13:12:37 +00:00 коммит произвёл Greg Kroah-Hartman
Родитель 877945759d
Коммит 4bc88f63d7
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -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;