diff mbox series

[1/1] media: tc358743: fix cleanup path

Message ID 20230502140612.2256850-1-alexander.stein@ew.tq-group.com
State New
Headers show
Series [1/1] media: tc358743: fix cleanup path | expand

Commit Message

Alexander Stein May 2, 2023, 2:06 p.m. UTC
When allocating a cec adapter, v4l2_async_register_subdev was called
already. Remove subdev from async list upon cec error.

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
---
I don't reallylike that __maybe_unused after the label, but I don't know
of any other way to get rid of the warning of unused label if CEC
support is disabled.

 drivers/media/i2c/tc358743.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/media/i2c/tc358743.c b/drivers/media/i2c/tc358743.c
index ad6a72b2bcf5..86fc7bf12685 100644
--- a/drivers/media/i2c/tc358743.c
+++ b/drivers/media/i2c/tc358743.c
@@ -2106,7 +2106,7 @@  static int tc358743_probe(struct i2c_client *client)
 		CEC_CAP_DEFAULTS | CEC_CAP_MONITOR_ALL, CEC_MAX_LOG_ADDRS);
 	if (IS_ERR(state->cec_adap)) {
 		err = PTR_ERR(state->cec_adap);
-		goto err_hdl;
+		goto err_async;
 	}
 	irq_mask |= MASK_CEC_RMSK | MASK_CEC_TMSK;
 #endif
@@ -2162,6 +2162,8 @@  static int tc358743_probe(struct i2c_client *client)
 		flush_work(&state->work_i2c_poll);
 	cancel_delayed_work(&state->delayed_work_enable_hotplug);
 	mutex_destroy(&state->confctl_mutex);
+err_async: __maybe_unused
+	v4l2_async_unregister_subdev(sd);
 err_hdl:
 	media_entity_cleanup(&sd->entity);
 	v4l2_ctrl_handler_free(&state->hdl);