]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
media: v4l: Avoid unaligned access warnings when printing 4cc modifiers
authorSakari Ailus <sakari.ailus@linux.intel.com>
Mon, 10 Jan 2022 14:53:12 +0000 (15:53 +0100)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 27 Apr 2022 09:57:07 +0000 (11:57 +0200)
commit62bdd17a57e2eb9a97cb09b89f24c3d7ca0625ca
tree40709d76b4af8746dffa843ad8b05e9225b67692
parente17f6dc011077b013dc30c698cf4deff7cce44b6
media: v4l: Avoid unaligned access warnings when printing 4cc modifiers

BugLink: https://bugs.launchpad.net/bugs/1969110
[ Upstream commit 24bb30c8c894ec7213ad810b46e2a6a4c12136c1 ]

Pointers V4L2 pixelformat and dataformat fields in a few packed structs
are directly passed to printk family of functions. This could result in an
unaligned access albeit no such possibility appears to exist at the
moment i.e. this clang warning appears to be a false positive.

Address the warning by copying the pixelformat or dataformat value to a
local variable first.

Reported-by: kernel test robot <lkp@intel.com>
Fixes: e927e1e0f0dd ("v4l: ioctl: Use %p4cc printk modifier to print FourCC codes")
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
(cherry picked from commit 26b1865f1fd4beaa84ca6e78c1b73def7d3fc01a)
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/media/v4l2-core/v4l2-ioctl.c