[PATCH 3/4] intel-hid: allocate correct amount of memory for private struct
Alex Hung
alex.hung at canonical.com
Tue Jun 28 09:02:56 UTC 2016
From: Wolfram Sang <wsa at the-dreams.de>
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 at the-dreams.de>
Signed-off-by: Darren Hart <dvhart at linux.intel.com>
(cherry picked from commit e8b69a51b4e72a168e8b3bc5fcac39a7de339864)
Signed-off-by: Alex Hung <alex.hung at canonical.com>
---
drivers/platform/x86/intel-hid.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/platform/x86/intel-hid.c b/drivers/platform/x86/intel-hid.c
index e20f23e..f93abc8 100644
--- a/drivers/platform/x86/intel-hid.c
+++ b/drivers/platform/x86/intel-hid.c
@@ -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);
--
2.7.4
More information about the kernel-team
mailing list