Re: [PATCH v2] Bluetooth: properly initialize conn_params in scan phase

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

 



Hi Jakub,

On Thu, Oct 15, 2015, Jakub Pawlowski wrote:
> This patch makes sure that conn_params that were created just for
> explicit_connect, will get properly deleted during cleanup.
> 
> Signed-off-by: Jakub Pawlowski <jpawlowski@xxxxxxxxxx>
> ---
>  net/bluetooth/hci_conn.c | 22 +++++++++++++++-------
>  net/bluetooth/mgmt.c     |  6 +++++-
>  2 files changed, 20 insertions(+), 8 deletions(-)

This one looks good to me, except:

> -	params = hci_conn_params_add(hdev, addr, addr_type);
> -	if (!params)
> -		return -EIO;
> +	params = hci_conn_params_lookup(hdev, addr, addr_type);
> +	if (!params) {
> +		params = hci_conn_params_add(hdev, addr, addr_type);
> +		if (!params)
> +			return -EIO;

I know it's in the original code, but since you're changing these lines
it might make sense to fix the error code to be something reasonable.
The only case hci_conn_params_add() will fail is memory allocation
failure, so EIO is kind of weird. ENOMEM would be more appropriate.

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