media: v4l2-compat-ioctl32.c: avoid sizeof(type)
commite5294484a664fc25972d541127897a8df63328ca
authorHans Verkuil <hans.verkuil@cisco.com>
Wed, 24 Jan 2018 10:01:31 +0000 (24 05:01 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Feb 2018 19:06:49 +0000 (16 20:06 +0100)
tree9bf0639d7a8b09eace386f14e1e40fda133d08db
parent991030bd0aa745478f12d97d4f3e3b66755b94cc
media: v4l2-compat-ioctl32.c: avoid sizeof(type)

commit 333b1e9f96ce05f7498b581509bb30cde03018bf upstream.

Instead of doing sizeof(struct foo) use sizeof(*up). There even were
cases where 4 * sizeof(__u32) was used instead of sizeof(kp->reserved),
which is very dangerous when the size of the reserved array changes.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/v4l2-core/v4l2-compat-ioctl32.c