From 01aa5f577448239a62d8181aff04d208215a48d9 Mon Sep 17 00:00:00 2001 From: Hsin-Yu Chao Date: Sun, 8 Mar 2015 14:14:15 +0800 Subject: [PATCH] audio/media: Fix crash at endpoint handling no reply When handling DBUS_ERROR_NO_REPLY error in media endpoint, the a2dp_setup gets unref'ed in the associated request callback when it's called for the first time. A crash happens in the later clear_endpoint call with below backtrace that, the request callback will be triggered again with NULL session. To fix this, remove the additional request callback so that every callback only gets triggered for once in clear_endpoint. --- profiles/audio/media.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/profiles/audio/media.c b/profiles/audio/media.c index 03646e610..f12569e81 100644 --- a/profiles/audio/media.c +++ b/profiles/audio/media.c @@ -274,9 +274,6 @@ static void endpoint_reply(DBusPendingCall *call, void *user_data) /* Clear endpoint configuration in case of NO_REPLY error */ if (dbus_error_has_name(&err, DBUS_ERROR_NO_REPLY)) { - if (request->cb) - request->cb(endpoint, NULL, size, - request->user_data); clear_endpoint(endpoint); dbus_message_unref(reply); dbus_error_free(&err); -- 2.47.3