aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacopo Mondi2018-06-12 05:43:26 -0400
committerMauro Carvalho Chehab2018-07-04 09:18:16 -0400
commit9863bc8695bc36e39aca289650e5a4f17c1bf628 (patch)
tree570276f9804bb9df0b75693c79d0d3a9a926a6b2
parent2241ea75b82c43e060d3da26fa2c286f6c872348 (diff)
media: rcar-vin: Cleanup notifier in error path
During the notifier initialization, memory for the list of associated async subdevices is reserved during the fwnode endpoint parsing from the v4l2-async framework. If the notifier registration fails, that memory should be released and the notifier 'cleaned up'. Catch the notifier registration error and perform the cleanup both for the group and the parallel notifiers. Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Acked-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
-rw-r--r--drivers/media/platform/rcar-vin/rcar-core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/media/platform/rcar-vin/rcar-core.c b/drivers/media/platform/rcar-vin/rcar-core.c
index 735e6ac66e48..87b29be2ea9e 100644
--- a/drivers/media/platform/rcar-vin/rcar-core.c
+++ b/drivers/media/platform/rcar-vin/rcar-core.c
@@ -571,6 +571,7 @@ static int rvin_parallel_graph_init(struct rvin_dev *vin)
ret = v4l2_async_notifier_register(&vin->v4l2_dev, &vin->notifier);
if (ret < 0) {
vin_err(vin, "Notifier registration failed\n");
+ v4l2_async_notifier_cleanup(&vin->group->notifier);
return ret;
}
@@ -773,6 +774,7 @@ static int rvin_mc_parse_of_graph(struct rvin_dev *vin)
&vin->group->notifier);
if (ret < 0) {
vin_err(vin, "Notifier registration failed\n");
+ v4l2_async_notifier_cleanup(&vin->group->notifier);
return ret;
}