media: v4l2-compat-ioctl32.c: avoid sizeof(type)
authorHans Verkuil <hans.verkuil@cisco.com>
Wed, 14 Feb 2018 11:44:27 +0000 (12:44 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 16 Feb 2018 19:23:01 +0000 (20:23 +0100)
commit16c25072560fb30df50c766260b69b14e3795194
tree32fae740a73af0b726782402d9fa42c1926b9643
parenta38becb087b20a34bdbfa63567f69671849025ad
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