From df62dbb69bae3662adf1e1aab4f9c75c4b1aa59e Mon Sep 17 00:00:00 2001 From: Radoslaw Jablonski Date: Fri, 23 Dec 2011 12:18:00 +0100 Subject: [PATCH] audio: Use headset_shutdown in headset_setconf_cb If pending connection will stay after state has been changed to HEADSET_STATE_DISCONNECTED, then crash may happen (e.g. when hs_connect will be called quickly again after that) To avoid that kind of problems using headset_shutdown, which does necessary cleanup first (finalizes pending connections) and after that changes state to HEADSET_STATE_DISCONNECTED. --- audio/media.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio/media.c b/audio/media.c index a2ef43773..a363b8e96 100644 --- a/audio/media.c +++ b/audio/media.c @@ -197,7 +197,7 @@ static void headset_setconf_cb(struct media_endpoint *endpoint, void *ret, if (ret != NULL) return; - headset_set_state(dev, HEADSET_STATE_DISCONNECTED); + headset_shutdown(dev); } static void clear_configuration(struct media_endpoint *endpoint) -- 2.47.3