diff options
author | Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> | 2021-07-09 16:25:51 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2021-09-30 10:07:33 +0200 |
commit | 8f7112630bd0c7f43ae4fba9f054c74c1fba650a (patch) | |
tree | 63175b3bc20b8b6f133d4cf81e5bd5deb669db8b /drivers | |
parent | media: rcar-vin: Refactor controls creation for video device (diff) | |
download | linux-8f7112630bd0c7f43ae4fba9f054c74c1fba650a.tar.xz linux-8f7112630bd0c7f43ae4fba9f054c74c1fba650a.zip |
media: rcar-vin: Fix error paths for rvin_mc_init()
The error paths of rvin_mc_init() do not clean up properly, fix this.
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/platform/rcar-vin/rcar-core.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/media/platform/rcar-vin/rcar-core.c b/drivers/media/platform/rcar-vin/rcar-core.c index 6ea561fcd7a3..bea388075216 100644 --- a/drivers/media/platform/rcar-vin/rcar-core.c +++ b/drivers/media/platform/rcar-vin/rcar-core.c @@ -946,17 +946,23 @@ static int rvin_mc_init(struct rvin_dev *vin) if (ret) return ret; + ret = rvin_create_controls(vin, NULL); + if (ret < 0) + return ret; + ret = rvin_group_get(vin); if (ret) - return ret; + goto err_controls; ret = rvin_mc_parse_of_graph(vin); if (ret) - rvin_group_put(vin); + goto err_group; - ret = rvin_create_controls(vin, NULL); - if (ret < 0) - return ret; + return 0; +err_group: + rvin_group_put(vin); +err_controls: + rvin_free_controls(vin); return ret; } |