Re: [PATCH 1/5] usb_debug: implement multi urb write

From: Oliver Neukum
Date: Wed May 06 2009 - 03:17:16 EST


Am Mittwoch, 6. Mai 2009 04:00:01 schrieb Jason Wessel:

in static void usb_debug_write_bulk_callback(struct urb *urb)
> +ÂÂÂÂÂÂÂif (status) {
> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂdbg("nonzero write bulk status received: %d", status);
> +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂreturn;
> +ÂÂÂÂÂÂÂ}

[..]
> +ÂÂÂÂÂÂÂspin_lock_irqsave(&priv->tx_lock, flags);
> +ÂÂÂÂÂÂÂ--priv->tx_outstanding_urbs;
> +ÂÂÂÂÂÂÂspin_unlock_irqrestore(&priv->tx_lock, flags);

That's a clear bug. If a URB finishes, you must decrease the counter, always
and without exception, even if status indicates an error.

Regards
Oliver

¢éì®&Þ~º&¶¬–+-±éÝ¥Šw®žË±Êâmébžìdz¹Þ)í…æèw*jg¬±¨¶‰šŽŠÝj/êäz¹ÞŠà2ŠÞ¨è­Ú&¢)ß«a¶Úþø®G«éh®æj:+v‰¨Šwè†Ù>Wš±êÞiÛaxPjØm¶Ÿÿà -»+ƒùdš_