Re: [PATCH v5] Bluetooth: btusb: Fix memory leak in play_deferred

From: jeffy
Date: Thu Jul 20 2017 - 06:56:37 EST


Hi Oliver,

On 07/20/2017 05:11 PM, Oliver Neukum wrote:
>+ if (err < 0) {
>+ if (err != -EPERM && err != -ENODEV)
>+ BT_ERR("%s urb %p submission failed (%d)",
>+ data->hdev->name, urb, -err);
>+ kfree(urb->setup_packet);
>+ usb_unanchor_urb(urb);
>+ usb_free_urb(urb);
> break;
>+ }
>
> data->tx_in_flight++;
>+ usb_free_urb(urb);
>+ }
>+
>+ /* Cleanup the rest deferred urbs. */
>+ while ((urb = usb_get_from_anchor(&data->deferred))) {
>+ BT_ERR("%s urb %p submission failed (%d)",
This looks very good, except for this message, which is incorrect.

hmm, since we already print error log when submission failed before, i'll remove this, thanks.