Message ID | CACVXFVOVjnWjqpKxbU98DAyUC_OSb8ZL-3WcyYuFXgPJn5UyuA@mail.gmail.com |
---|---|
State | RFC, archived |
Delegated to: | David Miller |
Headers | show |
On Thu, 22 Mar 2012, Ming Lei wrote: > So looks the correct fix should be below: > > diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c > index 4b8b52c..e36a821 100644 > --- a/drivers/net/usb/usbnet.c > +++ b/drivers/net/usb/usbnet.c > @@ -588,7 +588,7 @@ static int unlink_urbs (struct usbnet *dev, struct > sk_buff_head *q) > > entry = (struct skb_data *) skb->cb; > urb = entry->urb; > - > + usb_get_urb(urb); > spin_unlock_irqrestore(&q->lock, flags); > // during some PM-driven resume scenarios, > // these (async) unlinks complete immediately > @@ -597,6 +597,7 @@ static int unlink_urbs (struct usbnet *dev, struct > sk_buff_head *q) > netdev_dbg(dev->net, "unlink urb err, %d\n", retval); > else > count++; > + usb_put_urb(urb); > spin_lock_irqsave(&q->lock, flags); > } > spin_unlock_irqrestore (&q->lock, flags); > @@ -1028,7 +1029,6 @@ static void tx_complete (struct urb *urb) > } > > usb_autopm_put_interface_async(dev->intf); > - urb->dev = NULL; > entry->state = tx_done; > defer_bh(dev, skb, &dev->txq); > } Yes, that looks about right. But I'm not familiar with the details of usbnet. Alan Stern -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Am Mittwoch, 21. März 2012, 17:22:59 schrieb Ming Lei: > - > + usb_get_urb(urb); > spin_unlock_irqrestore(&q->lock, flags); > // during some PM-driven resume scenarios, > // these (async) unlinks complete immediately > @@ -597,6 +597,7 @@ static int unlink_urbs (struct usbnet *dev, struct > sk_buff_head *q) > netdev_dbg(dev->net, "unlink urb err, %d\n", retval); > else > count++; > + usb_put_urb(urb); Hi, this looks good, but could you add a comment explaining the reason for taking a reference? Regards Oliver -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 4b8b52c..e36a821 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c @@ -588,7 +588,7 @@ static int unlink_urbs (struct usbnet *dev, struct sk_buff_head *q) entry = (struct skb_data *) skb->cb; urb = entry->urb; - + usb_get_urb(urb); spin_unlock_irqrestore(&q->lock, flags); // during some PM-driven resume scenarios,