Commit e046b64b authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda/ca0132: Use struct_size()

For code simplification and safety, use struct_size() macro for
calculating the dsp_image_seg object size.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent a2d4560f
...@@ -2731,7 +2731,7 @@ static bool is_last(const struct dsp_image_seg *p) ...@@ -2731,7 +2731,7 @@ static bool is_last(const struct dsp_image_seg *p)
static size_t dsp_sizeof(const struct dsp_image_seg *p) static size_t dsp_sizeof(const struct dsp_image_seg *p)
{ {
return sizeof(*p) + p->count*sizeof(u32); return struct_size(p, data, p->count);
} }
static const struct dsp_image_seg *get_next_seg_ptr( static const struct dsp_image_seg *get_next_seg_ptr(
......
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