OSDN Git Service

AVCTP: Fix not destroying browsing channel if disconnected
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Sun, 27 Jan 2013 23:52:15 +0000 (17:52 -0600)
committerJohan Hedberg <johan.hedberg@intel.com>
Mon, 28 Jan 2013 00:00:02 +0000 (18:00 -0600)
If the browsing channel is disconnected it should be destroyed
immediatelly and set to NULL otherwise it will point to invalid channel.

profiles/audio/avctp.c

index 6ad2b66..6cac718 100644 (file)
@@ -485,6 +485,10 @@ static void avctp_set_state(struct avctp *session, avctp_state_t new_state)
                break;
        case AVCTP_STATE_CONNECTED:
                DBG("AVCTP Connected");
+               if (session->browsing) {
+                       avctp_channel_destroy(session->browsing);
+                       session->browsing = NULL;
+               }
                break;
        case AVCTP_STATE_BROWSING_CONNECTING:
                DBG("AVCTP Browsing Connecting");