media: vde: Use struct_size()
Use struct_size() which is much more common than this offsetof(). Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
This commit is contained in:
parent
26846dda3e
commit
aebe6f055d
@ -813,7 +813,7 @@ static int tegra_open(struct file *file)
|
||||
struct tegra_ctx *ctx;
|
||||
int err;
|
||||
|
||||
ctx = kzalloc(offsetof(struct tegra_ctx, ctrls[ARRAY_SIZE(ctrl_cfgs)]),
|
||||
ctx = kzalloc(struct_size(ctx, ctrls, ARRAY_SIZE(ctrl_cfgs)),
|
||||
GFP_KERNEL);
|
||||
if (!ctx)
|
||||
return -ENOMEM;
|
||||
|
Loading…
x
Reference in New Issue
Block a user