Re: [PATCH 2/2] Bluetooth: Temporary keys should be retained during connection

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

 



Hi Vishal,

On Fri, Apr 13, 2012, Vishal Agarwal wrote:
> If a key is non persistent then it should not be used in future
> connections but it should be kept for current connection. And it
> should be removed when connecion is removed.
> 
> Signed-off-by: Vishal Agarwal <vishal.agarwal@xxxxxxxxxxxxxx>
> ---
>  include/net/bluetooth/hci_core.h |    1 +
>  net/bluetooth/hci_core.c         |    8 ++++----
>  net/bluetooth/hci_event.c        |    2 ++
>  3 files changed, 7 insertions(+), 4 deletions(-)

In general the patch looks good but I'd simplify/shorten the following
just a tiny bit:

> -	if (!persistent) {
> -		list_del(&key->list);
> -		kfree(key);
> -	}
> +	if (!conn)
> +		return 0;
> +
> +	conn->flush_key = !persistent;
>  
>  	return 0;

Instead you could just do:

	if (conn)
		conn->flush_key = !persistent;

	return 0;

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