media: ipu3-cio2: Validate mbus format in setting subdev format
authorSakari Ailus <sakari.ailus@linux.intel.com>
Thu, 8 Oct 2020 19:33:26 +0000 (21:33 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Dec 2020 10:54:05 +0000 (11:54 +0100)
commitdd9d14e067fb0f887095b7ab49d1ea8398c9f051
tree1a9b1f0c063ced604b5e01b7eeb58cd41302ce13
parentffa790f9e17eb9e104256072ddec9b2405c35c61
media: ipu3-cio2: Validate mbus format in setting subdev format

commit a86cf9b29e8b12811cf53c4970eefe0c1d290476 upstream.

Validate media bus code, width and height when setting the subdev format.

This effectively reworks how setting subdev format is implemented in the
driver.

Fixes: c2a6a07afe4a ("media: intel-ipu3: cio2: add new MIPI-CSI2 driver")
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: stable@vger.kernel.org # v4.16 and up
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/media/pci/intel/ipu3/ipu3-cio2.c