[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMFT1=aG5edH-B2kdEkZRVg2gCBn1-_pPu-28TykcSjhBzcz_g@mail.gmail.com>
Date: Mon, 9 Feb 2026 09:06:38 -0600
From: Ziyi Guo <n7l8m4@...orthwestern.edu>
To: Alan Stern <stern@...land.harvard.edu>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>, linux-usb@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] usb: image: mdc800: kill download URB on timeout
On Mon, Feb 9, 2026 at 8:44 AM Alan Stern <stern@...land.harvard.edu> wrote:
>
> This code is not correct because it doesn't check to see whether the URB
> completed normally or timed out. The usb_kill_urb() call should not be
> issued if the URB completed normally.
>
> Also, the code should not access mdc800->download_urb->status until
> after the URB completes. The code should be structured like this:
>
> retval = wait_event_timeout(mdc800->download_wait,
> mdc800->downloaded,
> msecs_to_jiffies(TO_DOWNLOAD_GET_READY));
> if (!retval)
> usb_kill_urb(mdc800->download_urb);
> mdc800->downloaded = 0;
> if (mdc800->download_urb->status != 0) {
> ...
>
> Alan Stern
Hi Alan,
Thanks for your time and review, I'll revise the code and send a v2
version patch.
Powered by blists - more mailing lists