gb_audio_gb_get_topology() allocates the topology buffer using kzalloc() and transfers ownership to the codec module. The buffer is already freed on error via the free_topology label and during disconnect in gb_audio_disconnect(). Remove the outdated FIXME and replace it with a comment documenting the ownership semantics.
Signed-off-by: Ayaan Mirza Baig ayaanmirzabaig85@gmail.com --- drivers/staging/greybus/audio_module.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/greybus/audio_module.c b/drivers/staging/greybus/audio_module.c index 12c376c477b3..c7deeb99a41c 100644 --- a/drivers/staging/greybus/audio_module.c +++ b/drivers/staging/greybus/audio_module.c @@ -305,8 +305,10 @@ static int gb_audio_probe(struct gb_bundle *bundle, gbmodule->dev_id = gbmodule->mgmt_connection->intf->interface_id;
/* - * FIXME: malloc for topology happens via audio_gb driver - * should be done within codec driver itself + * The topology buffer is allocated by gb_audio_gb_get_topology() + * and ownership is transferred to this codec module. + * The codec is responsible for freeing the returned topology + * on error and on module removal. */ ret = gb_audio_gb_get_topology(gbmodule->mgmt_connection, &topology); if (ret) {