OSDN Git Service

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