1
0
Fork 0

intel-hid: allocate correct amount of memory for private struct

We want the size of the struct, not of a pointer to it. To be future
proof, just dereference the pointer to get the desired type.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
hifive-unleashed-5.1
Wolfram Sang 2016-02-21 15:22:27 +01:00 committed by Darren Hart
parent f52ab44fb7
commit e8b69a51b4
1 changed files with 1 additions and 2 deletions

View File

@ -181,8 +181,7 @@ static int intel_hid_probe(struct platform_device *device)
return -ENODEV;
}
priv = devm_kzalloc(&device->dev,
sizeof(struct intel_hid_priv *), GFP_KERNEL);
priv = devm_kzalloc(&device->dev, sizeof(*priv), GFP_KERNEL);
if (!priv)
return -ENOMEM;
dev_set_drvdata(&device->dev, priv);