summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/xilinx
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2017-08-30 13:18:04 -0400
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-10-31 13:51:45 -0400
commitb6ee3f0dcf43dc3e8dbbe9be9c4e728c8d52f1ba (patch)
tree4171a3b2634b8238b12188cd55fd629157efaeb6 /drivers/media/platform/xilinx
parentbce9e317cec9c4ffff3dde1170c0ad70f5e690c8 (diff)
downloadop-kernel-dev-b6ee3f0dcf43dc3e8dbbe9be9c4e728c8d52f1ba.zip
op-kernel-dev-b6ee3f0dcf43dc3e8dbbe9be9c4e728c8d52f1ba.tar.gz
media: v4l: async: Move async subdev notifier operations to a separate structure
The async subdev notifier .bound(), .unbind() and .complete() operations are function pointers stored directly in the v4l2_async_subdev structure. As the structure isn't immutable, this creates a potential security risk as the function pointers are mutable. To fix this, move the function pointers to a new v4l2_async_subdev_operations structure that can be made const in drivers. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/platform/xilinx')
-rw-r--r--drivers/media/platform/xilinx/xilinx-vipp.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/media/platform/xilinx/xilinx-vipp.c b/drivers/media/platform/xilinx/xilinx-vipp.c
index ebfdf33..d881cf0 100644
--- a/drivers/media/platform/xilinx/xilinx-vipp.c
+++ b/drivers/media/platform/xilinx/xilinx-vipp.c
@@ -351,6 +351,11 @@ static int xvip_graph_notify_bound(struct v4l2_async_notifier *notifier,
return -EINVAL;
}
+static const struct v4l2_async_notifier_operations xvip_graph_notify_ops = {
+ .bound = xvip_graph_notify_bound,
+ .complete = xvip_graph_notify_complete,
+};
+
static int xvip_graph_parse_one(struct xvip_composite_device *xdev,
struct device_node *node)
{
@@ -548,8 +553,7 @@ static int xvip_graph_init(struct xvip_composite_device *xdev)
xdev->notifier.subdevs = subdevs;
xdev->notifier.num_subdevs = num_subdevs;
- xdev->notifier.bound = xvip_graph_notify_bound;
- xdev->notifier.complete = xvip_graph_notify_complete;
+ xdev->notifier.ops = &xvip_graph_notify_ops;
ret = v4l2_async_notifier_register(&xdev->v4l2_dev, &xdev->notifier);
if (ret < 0) {
OpenPOWER on IntegriCloud