From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 131D41D63F3; Mon, 23 Mar 2026 14:17:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774275477; cv=none; b=eMfYPE+PI/4wwAspiVTauXFu3c0HyP6uiXeOdkNv0fGWUSZoG37w4/Shui3ZZCG2j7Meo/iXqlrIEGapr/og7+No4fvFPqRP1S0TA9O/E3+eZh7VueIdayJaKRdRjQlThVtlTVJAENaKm4DG3WTuRknNoqHlytvlO3aA8DtDt3o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774275477; c=relaxed/simple; bh=yOICwsUH/VkFRKBRDQYiqZZmxo7nm4Ufql/6+BhVvR4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kgWd6nLljqrOzx8gNqtWNqmMVColm389rVubTP4h59+WWym7yD+CgnlB/fCa7BKsSnOi8czDleyF/DnBg8+gmrqtY6uBefxqGRiSx0VqXm67l/FRIxRz4dig6D34kPz6MSS+vXxFMMoHX5UkOhU6Zxyj7zM46s7arfBVvUVNKW0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=CYdh8pcE; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="CYdh8pcE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 978A7C2BCB3; Mon, 23 Mar 2026 14:17:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1774275476; bh=yOICwsUH/VkFRKBRDQYiqZZmxo7nm4Ufql/6+BhVvR4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CYdh8pcEHzwDtNKAr7CP6kQFphqT9W+7PvvmbYLfIeOZLGUf9gb8qCNYseBa5KcvP /CG0MLgqjGSvSwyxcMfd/lYQwwARpMV+Dweukw/kK3pbefLAQLBJ5qwGDGliWOHNiJ DetqzwTgLJpMYq95QfFPjo6ylG+/HuIwHig9A0Kc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ziyi Guo , stable Subject: [PATCH 6.12 116/460] usb: image: mdc800: kill download URB on timeout Date: Mon, 23 Mar 2026 14:41:52 +0100 Message-ID: <20260323134529.485156111@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260323134526.647552166@linuxfoundation.org> References: <20260323134526.647552166@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ziyi Guo commit 1be3b77de4eb89af8ae2fd6610546be778e25589 upstream. mdc800_device_read() submits download_urb and waits for completion. If the timeout fires and the device has not responded, the function returns without killing the URB, leaving it active. A subsequent read() resubmits the same URB while it is still in-flight, triggering the WARN in usb_submit_urb(): "URB submitted while active" Check the return value of wait_event_timeout() and kill the URB if it indicates timeout, ensuring the URB is complete before its status is inspected or the URB is resubmitted. Similar to - commit 372c93131998 ("USB: yurex: fix control-URB timeout handling") - commit b98d5000c505 ("media: rc: iguanair: handle timeouts") Signed-off-by: Ziyi Guo Cc: stable Link: https://patch.msgid.link/20260209151937.2247202-1-n7l8m4@u.northwestern.edu Signed-off-by: Greg Kroah-Hartman --- drivers/usb/image/mdc800.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/usb/image/mdc800.c +++ b/drivers/usb/image/mdc800.c @@ -730,9 +730,11 @@ static ssize_t mdc800_device_read (struc mutex_unlock(&mdc800->io_lock); return len-left; } - wait_event_timeout(mdc800->download_wait, + 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) {