Re: [PATCH] Fix add disconnect watch in connecting state

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Daniel,

On Thu, Nov 04, 2010, Daniel Örstadius wrote:
> If disconnect_cb is added only in the connected state, the callback
> will not be triggered if Device.Disconnected is called during a
> connection setup and the RFCOMM channel of HFP will not be cleanly
> disconnected.
> ---
>  audio/device.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/audio/device.c b/audio/device.c
> index 9554c7b..2e75538 100644
> --- a/audio/device.c
> +++ b/audio/device.c
> @@ -231,7 +231,7 @@ static void device_set_state(struct audio_device *dev, audio_state_t new_state)
>  							priv->dc_id);
>  			priv->dc_id = 0;
>  		}
> -	} else if (new_state == AUDIO_STATE_CONNECTED)
> +	} else
>  		priv->dc_id = device_add_disconnect_watch(dev->btd_dev,
>  						disconnect_cb, dev, NULL);
>  

This doesn't seem quite right to me. Aren't you now adding a disconnect
callback twice: once for CONNECTING and a second time for CONNECTED? It
seems like you should only add it when new_state == CONNECTING, right?

Johan
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux