提交 a2d4560f 编写于 作者: T Takashi Iwai

ALSA: hda: Use struct_size()

For code simplification and safety, use struct_size() macro for
calculating the hda_conn_list object size with the variable array.
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 65be9580
......@@ -122,7 +122,7 @@ static int add_conn_list(struct hda_codec *codec, hda_nid_t nid, int len,
{
struct hda_conn_list *p;
p = kmalloc(sizeof(*p) + len * sizeof(hda_nid_t), GFP_KERNEL);
p = kmalloc(struct_size(p, conns, len), GFP_KERNEL);
if (!p)
return -ENOMEM;
p->len = len;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册