Commit 9863bc86 authored by Jacopo Mondi's avatar Jacopo Mondi Committed by Mauro Carvalho Chehab

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: default avatarJacopo Mondi <jacopo+renesas@jmondi.org>
Acked-by: default avatarNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 2241ea75
...@@ -571,6 +571,7 @@ static int rvin_parallel_graph_init(struct rvin_dev *vin) ...@@ -571,6 +571,7 @@ static int rvin_parallel_graph_init(struct rvin_dev *vin)
ret = v4l2_async_notifier_register(&vin->v4l2_dev, &vin->notifier); ret = v4l2_async_notifier_register(&vin->v4l2_dev, &vin->notifier);
if (ret < 0) { if (ret < 0) {
vin_err(vin, "Notifier registration failed\n"); vin_err(vin, "Notifier registration failed\n");
v4l2_async_notifier_cleanup(&vin->group->notifier);
return ret; return ret;
} }
...@@ -773,6 +774,7 @@ static int rvin_mc_parse_of_graph(struct rvin_dev *vin) ...@@ -773,6 +774,7 @@ static int rvin_mc_parse_of_graph(struct rvin_dev *vin)
&vin->group->notifier); &vin->group->notifier);
if (ret < 0) { if (ret < 0) {
vin_err(vin, "Notifier registration failed\n"); vin_err(vin, "Notifier registration failed\n");
v4l2_async_notifier_cleanup(&vin->group->notifier);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment