From 66c7b6b4437862268726c1c7c493340d47e4c2ab Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Sun, 5 May 2013 11:32:27 +0300 Subject: [PATCH] media: Fix not canceling requests properly if endpoint exit If endpoint exit while a request is pending, e.g. due to a crash, the callback should be called with ret set to NULL otherwise the code that has generated the request will not notice the request has been canceled leaving the endpoint unusable. --- profiles/audio/media.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/profiles/audio/media.c b/profiles/audio/media.c index 4c23960ed..cab79b5ff 100644 --- a/profiles/audio/media.c +++ b/profiles/audio/media.c @@ -127,6 +127,9 @@ static void media_endpoint_cancel(struct endpoint_request *request) endpoint->requests = g_slist_remove(endpoint->requests, request); + if (request->cb) + request->cb(endpoint, NULL, -1, request->user_data); + endpoint_request_free(request); } -- 2.47.3