media: v4l2-compat-ioctl32.c: avoid sizeof(type)
authorHans Verkuil <hans.verkuil@cisco.com>
Wed, 14 Feb 2018 11:48:22 +0000 (12:48 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 17 Feb 2018 12:21:16 +0000 (13:21 +0100)
commitdaff4d009f4f7fb3b1f041b76c0782cb96d99d56
treea501b3ef164228c71addb7b28cfeceb764d4c751
parent81e0acf07015dbd3e0b45e8f8a053d64b804bb46
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