diff --git a/drivers/media/i2c/cx25840/cx25840-core.c b/drivers/media/i2c/cx25840/cx25840-core.c index 8110d40931d9..8b7dd43ed208 100644 --- a/drivers/media/i2c/cx25840/cx25840-core.c +++ b/drivers/media/i2c/cx25840/cx25840-core.c @@ -3962,6 +3962,7 @@ static int cx25840_probe(struct i2c_client *client) int err = state->hdl.error; v4l2_ctrl_handler_free(&state->hdl); + media_entity_cleanup(&sd->entity); return err; } if (!is_cx2583x(state)) @@ -3986,6 +3987,7 @@ static void cx25840_remove(struct i2c_client *client) cx25840_ir_remove(sd); v4l2_device_unregister_subdev(sd); v4l2_ctrl_handler_free(&state->hdl); + media_entity_cleanup(&sd->entity); } static const struct i2c_device_id cx25840_id[] = {