# Re: \[PATCH 2/2\] Bluetooh: Fix hci\_cc\_read\_local\_ext\_features()

- From: Marcel Holtmann \<marcel@holtmann.org\>
- Date: 2011-12-30 19:17:15 
- List: linux-bluetooth
- Page: https://ratatoskr.run/linux-bluetooth/2011/12/9616634
- Thread: https://ratatoskr.run/linux-bluetooth/2011/12/9616637/t.md

```text
Hi Andre,

> Copy the Features value according to the Page number.
> 
> Signed-off-by: Andre Guedes <redacted>
> ---
>  net/bluetooth/hci_event.c |    9 ++++++++-
>  1 files changed, 8 insertions(+), 1 deletions(-)
> 
> diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
> index 37c31c5..10152d2 100644
> --- a/net/bluetooth/hci_event.c
> +++ b/net/bluetooth/hci_event.c
> @@ -711,7 +711,14 @@ static void hci_cc_read_local_ext_features(struct hci_dev *hdev,
>  	if (rp->status)
>  		return;
>  
> -	memcpy(hdev->host_features, rp->features, 8);
> +	switch (rp->page) {
> +	case 0:
> +		memcpy(hdev->features, rp->features, 8);
> +		break;
> +	case 1:
> +		memcpy(hdev->host_features, rp->features, 8);
> +		break;
> +	}
>  
>  	hci_req_complete(hdev, HCI_OP_READ_LOCAL_EXT_FEATURES, rp->status);
>  }

I was fine with just handling page 1 properly since we do not use
read_local_ext_features for page 0 in the first place. However this is
also fine with me.

Acked-by: Marcel Holtmann <marcel@holtmann.org>

Regards

Marcel


```
