From patchwork Mon Mar 31 13:25:01 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver Neukum X-Patchwork-Id: 877437 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B9685211299 for ; Mon, 31 Mar 2025 13:26:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743427586; cv=none; b=XTx+Fqc6+Y20Zl3IwtHGVRelV6eUbpED9ZypvmwVptQ7HFfrBd/4uKW4WPXpG1s5uV3spncxY03G56S4nuwL3hR0M2r19vMPHetX91nQHlCSsbGGonyG98l29k8AE1H9F6YHw00TUsT/CyWCph3NmOhYj1z6db9q09Ha72zOnBQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743427586; c=relaxed/simple; bh=aU3au+otIKSxltUYnJ8K39yl1EqCoQKcIiDbdQBsWEc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DImJFtDB4CfyjAxwkrHsmtXigURJZ+cLYyHnWR7Ji1OdNwawGO1wQzD+3N4qckGnqHcASWbQOVG8nCG2BxU451dcE1YcoFOdqfYxtuHzPMg5Ola61RDsC6s+XEJU4hWhoRzNYkR8LP86OmBV2ilKSICDjkwzX342h7vRsNWCx+A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id EF4C1211EA; Mon, 31 Mar 2025 13:26:16 +0000 (UTC) Authentication-Results: smtp-out1.suse.de; none Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id C52AA13A56; Mon, 31 Mar 2025 13:26:16 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id QCMJL/iX6meJIQAAD6G6ig (envelope-from ); Mon, 31 Mar 2025 13:26:16 +0000 From: Oliver Neukum To: gregkh@linuxfoundation.org, bjorn@mork.no, loic.poulain@linaro.org, linux-usb@vger.kernel.org, netdev@vger.kernel.org Cc: Oliver Neukum Subject: [PATCH 1/4] USB: wdm: handle IO errors in wdm_wwan_port_start Date: Mon, 31 Mar 2025 15:25:01 +0200 Message-ID: <20250331132614.51902-2-oneukum@suse.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250331132614.51902-1-oneukum@suse.com> References: <20250331132614.51902-1-oneukum@suse.com> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[]; ASN(0.00)[asn:25478, ipnet:::/0, country:RU] X-Spam-Flag: NO X-Spam-Score: -4.00 X-Rspamd-Queue-Id: EF4C1211EA X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Action: no action X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Level: In case submitting the URB fails we must undo what we've done so far. Fixes: cac6fb015f71 ("usb: class: cdc-wdm: WWAN framework integration") Signed-off-by: Oliver Neukum --- drivers/usb/class/cdc-wdm.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index 856488a7cb6b..12038aa43942 100644 --- a/drivers/usb/class/cdc-wdm.c +++ b/drivers/usb/class/cdc-wdm.c @@ -831,6 +831,7 @@ static struct usb_class_driver wdm_class = { static int wdm_wwan_port_start(struct wwan_port *port) { struct wdm_device *desc = wwan_port_get_drvdata(port); + int rv; /* The interface is both exposed via the WWAN framework and as a * legacy usbmisc chardev. If chardev is already open, just fail @@ -850,7 +851,15 @@ static int wdm_wwan_port_start(struct wwan_port *port) wwan_port_txon(port); /* Start getting events */ - return usb_submit_urb(desc->validity, GFP_KERNEL); + rv = usb_submit_urb(desc->validity, GFP_KERNEL); + if (rv < 0) { + wwan_port_txoff(port); + desc->manage_power(desc->intf, 0); + /* this must be last lest we race with chardev open */ + clear_bit(WDM_WWAN_IN_USE, &desc->flags); + } + + return rv; } static void wdm_wwan_port_stop(struct wwan_port *port) From patchwork Mon Mar 31 13:25:02 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver Neukum X-Patchwork-Id: 877666 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3476B211299 for ; Mon, 31 Mar 2025 13:26:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743427581; cv=none; b=pBsQ3FC94Sns7fayP5IkggOpa0j3ns2eY+KzeenPZc+MY5NDABmvxOw1QSgZGo402VS16hOH2DvKbxvftUZRQzSmy4yUlVaAJjXQCmAa345DDK2Dgmswpv9752gy4n8E+Rdqb1O0KlhrTtTFHUxNWldnupa92J4YvZAeKq5JY1Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743427581; c=relaxed/simple; bh=HrGKD0KbZmhm6DKZt5OMcxAy1MWarDSf6WaP2/wp06Y=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=k6WAW891C5xgE2fxR8xA4DFO0RMcH4cJ4dpcKiIuH9J6wKiiyC6Yv40HtfKxpzdBrvoMnQ4shzmXrU8bRzkCKtSquE0u8f4HJRc+PcfpMC3Jzeim9ilp2mNbjSoV602U8rcVEus+sgHwwycTVga3GpOJrVIBzf07JPaycwZj300= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=TKRtfVRh; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=TKRtfVRh; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="TKRtfVRh"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="TKRtfVRh" Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 2DBD51F456; Mon, 31 Mar 2025 13:26:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1743427577; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qjSnAYDRUpOAk4hdheIUEiWeZ1WwxhmbKrlRr2urYws=; b=TKRtfVRhtAmJTtTvIdzhIm1Y7eede7SdNcl7tQ38ICgzuBxHkBGJe9UrFALLWNpape6Eov 941tQV6FZ1VK6iwNlmhNVq0sY+AYKH7zX4DtIuEf5+pHgLqTEWApt/FA6aGcw1GDnUk7wf nqYv+B4kJ9Bjk3iHG0uAIKA1lZAQ3+Q= Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1743427577; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qjSnAYDRUpOAk4hdheIUEiWeZ1WwxhmbKrlRr2urYws=; b=TKRtfVRhtAmJTtTvIdzhIm1Y7eede7SdNcl7tQ38ICgzuBxHkBGJe9UrFALLWNpape6Eov 941tQV6FZ1VK6iwNlmhNVq0sY+AYKH7zX4DtIuEf5+pHgLqTEWApt/FA6aGcw1GDnUk7wf nqYv+B4kJ9Bjk3iHG0uAIKA1lZAQ3+Q= Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 012FB13A1F; Mon, 31 Mar 2025 13:26:16 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id UN+9OviX6meJIQAAD6G6ig (envelope-from ); Mon, 31 Mar 2025 13:26:16 +0000 From: Oliver Neukum To: gregkh@linuxfoundation.org, bjorn@mork.no, loic.poulain@linaro.org, linux-usb@vger.kernel.org, netdev@vger.kernel.org Cc: Oliver Neukum Subject: [PATCH 2/4] USB: wdm: close race between wdm_open and wdm_wwan_port_stop Date: Mon, 31 Mar 2025 15:25:02 +0200 Message-ID: <20250331132614.51902-3-oneukum@suse.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250331132614.51902-1-oneukum@suse.com> References: <20250331132614.51902-1-oneukum@suse.com> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Level: X-Spamd-Result: default: False [-6.80 / 50.00]; REPLY(-4.00)[]; BAYES_HAM(-3.00)[99.99%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_FIVE(0.00)[6]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.com:email,suse.com:mid,imap1.dmz-prg2.suse.org:helo]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_ALL(0.00)[] X-Spam-Score: -6.80 X-Spam-Flag: NO Clearing WDM_WWAN_IN_USE must be the last action or we can open a chardev whose URBs are still poisoned Fixes: cac6fb015f71 ("usb: class: cdc-wdm: WWAN framework integration") Signed-off-by: Oliver Neukum --- drivers/usb/class/cdc-wdm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index 12038aa43942..e67844618da6 100644 --- a/drivers/usb/class/cdc-wdm.c +++ b/drivers/usb/class/cdc-wdm.c @@ -870,8 +870,9 @@ static void wdm_wwan_port_stop(struct wwan_port *port) poison_urbs(desc); desc->manage_power(desc->intf, 0); clear_bit(WDM_READ, &desc->flags); - clear_bit(WDM_WWAN_IN_USE, &desc->flags); unpoison_urbs(desc); + /* this must be last lest we open a poisoned device */ + clear_bit(WDM_WWAN_IN_USE, &desc->flags); } static void wdm_wwan_port_tx_complete(struct urb *urb) From patchwork Mon Mar 31 13:25:03 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver Neukum X-Patchwork-Id: 877665 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B67ED21171F for ; Mon, 31 Mar 2025 13:26:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743427592; cv=none; b=bO8zQQsrO2YIqNG7d4RLQkxsSli4tL3t22HsNfj4aK0wfkM7/01x4iJfjQfyvVXPF48wehXb/O4DJIoJziJTAfNfggTZllnrOQYAvmLExTKh+71wS1tvyenKWS3VrnUnwov0FN1Y6E+nM3iZH2HGZVgC3fVzlnvXVThuFKJI8UI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743427592; c=relaxed/simple; bh=e4c9eBxKYrVpzpWQRIo6gJdtJ63gcveHUyZSTnGTixs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ba0BZ72dG/Ie1srsRKkcalani4c/uGm/97b0xxPhla079dp9XDPPtFes1FtsHMIMTdxCtmwgNe5B5kaYXuqWcQaz9SGRY204cM2K9URy/VsRvSpeleCK82DwWpHNJSK7VwAR/jNCGPpc8tDYkZTYXUQ0ZdOTPIXe3qxl9w45FoI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 61C7A21181; Mon, 31 Mar 2025 13:26:17 +0000 (UTC) Authentication-Results: smtp-out1.suse.de; none Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 32B7D13A56; Mon, 31 Mar 2025 13:26:17 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id +AcsC/mX6meJIQAAD6G6ig (envelope-from ); Mon, 31 Mar 2025 13:26:17 +0000 From: Oliver Neukum To: gregkh@linuxfoundation.org, bjorn@mork.no, loic.poulain@linaro.org, linux-usb@vger.kernel.org, netdev@vger.kernel.org Cc: Oliver Neukum Subject: [PATCH 3/4] USB: wdm: wdm_wwan_port_tx_complete mutex in atomic context Date: Mon, 31 Mar 2025 15:25:03 +0200 Message-ID: <20250331132614.51902-4-oneukum@suse.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250331132614.51902-1-oneukum@suse.com> References: <20250331132614.51902-1-oneukum@suse.com> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[]; ASN(0.00)[asn:25478, ipnet:::/0, country:RU] X-Spam-Flag: NO X-Spam-Score: -4.00 X-Rspamd-Queue-Id: 61C7A21181 X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Action: no action X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Level: wdm_wwan_port_tx_complete is called from a completion handler with irqs disabled and possible in IRQ context usb_autopm_put_interface can take a mutex. Hence usb_autopm_put_interface_async must be used. Fixes: cac6fb015f71 ("usb: class: cdc-wdm: WWAN framework integration") Signed-off-by: Oliver Neukum --- drivers/usb/class/cdc-wdm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index e67844618da6..f50c3ad86eca 100644 --- a/drivers/usb/class/cdc-wdm.c +++ b/drivers/usb/class/cdc-wdm.c @@ -880,7 +880,7 @@ static void wdm_wwan_port_tx_complete(struct urb *urb) struct sk_buff *skb = urb->context; struct wdm_device *desc = skb_shinfo(skb)->destructor_arg; - usb_autopm_put_interface(desc->intf); + usb_autopm_put_interface_async(desc->intf); wwan_port_txon(desc->wwanp); kfree_skb(skb); } From patchwork Mon Mar 31 13:25:04 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oliver Neukum X-Patchwork-Id: 877436 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 30BCC211A0D for ; Mon, 31 Mar 2025 13:26:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743427598; cv=none; b=fsvECDwu6fZDXBee4AonbmnIyQOB+QRkl+DnS6+TZ3H8GMdwz/nKCzFZQAq6sTV0AeA59kySAZpfbPdabNl0FTaXdT8ytupVL+K3Pmx55N/cuXfbDBnLB8o178DRx9OthWwmdI3P6DIm9sog3PETSfYyHyrc1SB/DgAe/8hOMiM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743427598; c=relaxed/simple; bh=MWcmn9Ady0wORXEFK5Tlc2hcuz8QyQNKdfv1ITUwoVk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ICeWhnLr8rUOs538KxZmySHDLNBMVcmodo5BMcmOJ8tvPgMrM77yi6iGjv0divjiyQmF/Z5jJqLuBlbjEEeS2JrcxFC1hJrwD22AhJ4RhASlNqwxe0k/biGdQRN21vqxSQHpXZN8qaBamcctjzxqZIFz/L9QWokpHxBeBTJp1YY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 97C3E211EB; Mon, 31 Mar 2025 13:26:17 +0000 (UTC) Authentication-Results: smtp-out1.suse.de; none Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 638BD13A1F; Mon, 31 Mar 2025 13:26:17 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id GHwxF/mX6meJIQAAD6G6ig (envelope-from ); Mon, 31 Mar 2025 13:26:17 +0000 From: Oliver Neukum To: gregkh@linuxfoundation.org, bjorn@mork.no, loic.poulain@linaro.org, linux-usb@vger.kernel.org, netdev@vger.kernel.org Cc: Oliver Neukum Subject: [PATCH 4/4] USB: wdm: add annotation Date: Mon, 31 Mar 2025 15:25:04 +0200 Message-ID: <20250331132614.51902-5-oneukum@suse.com> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250331132614.51902-1-oneukum@suse.com> References: <20250331132614.51902-1-oneukum@suse.com> Precedence: bulk X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spam-Level: X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[]; ASN(0.00)[asn:25478, ipnet:::/0, country:RU] X-Spam-Score: -4.00 X-Spam-Flag: NO X-Rspamd-Queue-Id: 97C3E211EB X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Action: no action X-Rspamd-Server: rspamd2.dmz-prg2.suse.org This is not understandable without a comment on endianness Fixes: afba937e540c9 ("USB: CDC WDM driver") Signed-off-by: Oliver Neukum --- drivers/usb/class/cdc-wdm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index f50c3ad86eca..caf721c11e9c 100644 --- a/drivers/usb/class/cdc-wdm.c +++ b/drivers/usb/class/cdc-wdm.c @@ -910,7 +910,7 @@ static int wdm_wwan_port_tx(struct wwan_port *port, struct sk_buff *skb) req->bRequestType = (USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE); req->bRequest = USB_CDC_SEND_ENCAPSULATED_COMMAND; req->wValue = 0; - req->wIndex = desc->inum; + req->wIndex = desc->inum; /* already converted */ req->wLength = cpu_to_le16(skb->len); skb_shinfo(skb)->destructor_arg = desc;