Thread (1 message) 1 message, 1 author, 2014-02-13

Re: [PATCH] usbnet: remove generic hard_header_len check

From: Bjørn Mork <bjorn@mork.no>
Date: 2014-02-13 11:37:22
Also in: lkml

Emil Goode [off-list ref] writes:
Yes I should have put a comment in the changelog about this. All skbs that
are passed to rx_process have their state set to rx_cleanup and just because
the skb was cloned doesn't mean that we should free the original in a
different way. As it is I think we are acctually missing a call to
usb_free_urb that is called on the common rx_cleanup path.
Yes, I wondered about that as well, thinking that this part actually
should be a separate patch for net+stable.

But then I wondered how we could possibly have had a bug like that
living here for so long, and the answer is we haven't.  You don't want
to free the URB.  It is already resubmitted with a different skb as its
buffer.  The call to usb_free_urb in the rx_cleanup path is there only
for the cases where the URB is not resubmitted. The rx_complete callback
is controlling this by updating entry->urb as appropriate.  So it will
always be NULL if rx_process is called, and the call to usb_free_urb has
no effect.

Rearranging this code to always take the same cleanup path is still a
very nice cleanup IMHO.


Bjørn
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help