提交 e8b69a51 编写于 作者: W Wolfram Sang 提交者: Darren Hart

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: NWolfram Sang <wsa@the-dreams.de>
Signed-off-by: NDarren Hart <dvhart@linux.intel.com>
上级 f52ab44f
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册