]> git.baikalelectronics.ru Git - kernel.git/commit
media: v4l2-fwnode: Check subdev count after checking port
authorTomasz Figa <tfiga@chromium.org>
Wed, 15 Nov 2017 11:55:22 +0000 (06:55 -0500)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Thu, 30 Nov 2017 09:43:05 +0000 (04:43 -0500)
commit7629e31f18d4519c5600c220ac1493f8b70616af
tree7cbceadc9bd955a31d13467bf2b0d32590f64546
parent0bf9dfb80286d4821abe5bf586913e2cac30b615
media: v4l2-fwnode: Check subdev count after checking port

Current implementation of __v4l2_async_notifier_parse_fwnode_endpoints()
checks first whether subdev_count >= subdev_max and only then whether
the port being parsed matches the given port index. This triggers an
error in otherwise valid cases of skipping ports that do not match.

Fix this by moving the check below the port index check.

Fixes: 45e5264a2eed ("media: v4l: fwnode: Support generic parsing of graph endpoints in a device")
Signed-off-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/v4l2-core/v4l2-fwnode.c