media: intel/ipu6: add csi2 port sanity check in notifier bound
authorBingbu Cao <bingbu.cao@intel.com>
Wed, 29 May 2024 06:43:21 +0000 (14:43 +0800)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Thu, 30 May 2024 14:34:59 +0000 (16:34 +0200)
commitffb9072bce200a4d004006e8b40c366933cf517b
treeffcbc987deb238a02cfe5e1d45471cf92dbcb7c6
parent54880795b494e6557b47fe3cf3f21f2f54c2aa68
media: intel/ipu6: add csi2 port sanity check in notifier bound

Invalid csi2 port will break the isys notifier bound ops as it is
trying to access an invalid csi2 sub-device instance based on the
port. It will trigger a mc warning, and it will cause the sensor
driver to unbound an inexistent isys csi2 and crash. Adding a
csi2 port sanity check, return error to avoid such case.

Fixes: f50c4ca0a820 ("media: intel/ipu6: add the main input system driver")
Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
[Sakari Ailus: Fix spelling of "nports" field.]
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/pci/intel/ipu6/ipu6-isys.c