Commit a735d297 authored by Wolfram Sang's avatar Wolfram Sang Committed by Kamal Mostafa

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

BugLink: http://bugs.launchpad.net/bugs/1589886

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: default avatarWolfram Sang <wsa@the-dreams.de>
Signed-off-by: default avatarDarren Hart <dvhart@linux.intel.com>
(cherry picked from commit e8b69a51)
Signed-off-by: default avatarAlex Hung <alex.hung@canonical.com>
Acked-by: default avatarStefan Bader <stefan.bader@canonical.com>
Acked-by: default avatarBrad Figg <brad.figg@canonical.com>
Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
parent 36074d97
......@@ -180,8 +180,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);
......
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