Re: [PATCH v2] Bluetooth: Add support for setting SSP debug mode

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

 



Hi Marcel,

On Sat, Oct 19, 2013, Marcel Holtmann wrote:
> +static int ssp_debug_mode_set(void *data, u64 val)
> +{
> +	struct hci_dev *hdev = data;
> +	struct sk_buff *skb;
> +	__u8 mode;
> +
> +	if (val != 0 && val != 1)
> +		return -EINVAL;
> +
> +	if (!test_bit(HCI_UP, &hdev->flags))
> +		return -ENETDOWN;
> +
> +	hci_req_lock(hdev);
> +	mode = val;
> +	skb = __hci_cmd_sync(hdev, HCI_OP_WRITE_SSP_DEBUG_MODE, sizeof(mode),
> +			     &mode, HCI_CMD_TIMEOUT);
> +	hci_req_unlock(hdev);
> +
> +	if (IS_ERR(skb))
> +		return PTR_ERR(skb);
> +
> +	if (skb->data[0]) {
> +		u8 status = skb->data[0];
> +		kfree_skb(skb);
> +		return -bt_to_errno(status);
> +	}
> +
> +	hci_dev_lock(hdev);
> +	hdev->ssp_debug_mode = val;
> +	hci_dev_unlock(hdev);
> +
> +	return 0;
> +}

Looks like skb is being leaked here if the HCI command succeeds.

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