]> git.itanic.dy.fi Git - linux-stable/commit
media: v4l2-compat-ioctl32.c: avoid sizeof(type)
authorHans Verkuil <hans.verkuil@cisco.com>
Wed, 24 Jan 2018 10:01:31 +0000 (05:01 -0500)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Tue, 30 Jan 2018 12:28:35 +0000 (07:28 -0500)
commit333b1e9f96ce05f7498b581509bb30cde03018bf
treeae136791b2796e427870be4e82da76b81e992b2b
parent486c521510c44a04cd756a9267e7d1e271c8a4ba
media: v4l2-compat-ioctl32.c: avoid sizeof(type)

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>
Cc: <stable@vger.kernel.org> # for v4.15 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/v4l2-core/v4l2-compat-ioctl32.c