media: v4l: subdev: Make link validation safer
authorSakari Ailus <sakari.ailus@linux.intel.com>
Fri, 24 Feb 2023 15:00:46 +0000 (16:00 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Sat, 18 Mar 2023 07:48:15 +0000 (08:48 +0100)
commit55f1ecb1199000932cf82e357841cc7498ac904f
tree4accd9060f034f46876e7e2a1ee3a7c9c88ece76
parent530779157c06d64721b81d60f7ae2715cdf338d2
media: v4l: subdev: Make link validation safer

Link validation currently accesses invalid pointers if the link passed to
it is not between two sub-devices. This is of course a driver bug.

Ignore the error but print a warning message, as this is how it used to
work previously.

Fixes: a6b995ed03ff ("media: subdev: use streams in v4l2_subdev_link_validate()")
Reported-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/v4l2-core/v4l2-subdev.c