提交 f3278e3f 编写于 作者: K Kees Cook

leds: Use struct_size() in allocation

This case got missed by the earlier treewide struct_size() conversions.
Signed-off-by: NKees Cook <keescook@chromium.org>
上级 6566f907
......@@ -237,8 +237,7 @@ static int cr0014114_probe(struct spi_device *spi)
return -ENODEV;
}
priv = devm_kzalloc(&spi->dev,
sizeof(*priv) + sizeof(*priv->leds) * count,
priv = devm_kzalloc(&spi->dev, struct_size(priv, leds, count),
GFP_KERNEL);
if (!priv)
return -ENOMEM;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册