media: v4l2-compat-ioctl32.c: avoid sizeof(type)
authorHans Verkuil <hans.verkuil@cisco.com>
Wed, 14 Feb 2018 12:03:16 +0000 (13:03 +0100)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 3 Mar 2018 15:51:06 +0000 (15:51 +0000)
commit3d4a1d4e7c67e3e6b083797e9ef220cf287b45a9
treefaf5cc05cc23555114505a346b77a92a92cc1f59
parent6e5253f46b0c661be373d9e7da49b46ebfd756cb
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>
[bwh: Rebased on top of some earlier fixes]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/media/video/v4l2-compat-ioctl32.c