Netdev Archive on
help / color / mirror / Atom feed
From: Marc Kleine-Budde <>
Cc:,,,, Pavel Skripkin <>,
	linux-stable <>,
	Yasushi SHOJI <>,
	Yasushi SHOJI <>,
	Marc Kleine-Budde <>
Subject: [PATCH net 3/6] can: mcba_usb_start(): add missing urb->transfer_dma initialization
Date: Fri, 30 Jul 2021 09:05:23 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

From: Pavel Skripkin <>

Yasushi reported, that his Microchip CAN Analyzer stopped working
since commit 91c02557174b ("can: mcba_usb: fix memory leak in
mcba_usb"). The problem was in missing urb->transfer_dma

In my previous patch to this driver I refactored mcba_usb_start() code
to avoid leaking usb coherent buffers. To archive it, I passed local
stack variable to usb_alloc_coherent() and then saved it to private
array to correctly free all coherent buffers on ->close() call. But I
forgot to initialize urb->transfer_dma with variable passed to

All of this was causing device to not work, since dma addr 0 is not
valid and following log can be found on bug report page, which points
exactly to problem described above.

| DMAR: [DMA Write] Request device [00:14.0] PASID ffffffff fault addr 0 [fault reason 05] PTE Write access is not set

Fixes: 91c02557174b ("can: mcba_usb: fix memory leak in mcba_usb")
Cc: linux-stable <>
Reported-by: Yasushi SHOJI <>
Signed-off-by: Pavel Skripkin <>
Tested-by: Yasushi SHOJI <>
[mkl: fixed typos in commit message - thanks Yasushi SHOJI]
Signed-off-by: Marc Kleine-Budde <>
 drivers/net/can/usb/mcba_usb.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/can/usb/mcba_usb.c b/drivers/net/can/usb/mcba_usb.c
index a45865bd7254..a1a154c08b7f 100644
--- a/drivers/net/can/usb/mcba_usb.c
+++ b/drivers/net/can/usb/mcba_usb.c
@@ -653,6 +653,8 @@ static int mcba_usb_start(struct mcba_priv *priv)
+		urb->transfer_dma = buf_dma;
 		usb_fill_bulk_urb(urb, priv->udev,
 				  usb_rcvbulkpipe(priv->udev, MCBA_USB_EP_IN),
 				  buf, MCBA_USB_RX_BUFF_SIZE,

  parent reply	other threads:[~2021-07-30  7:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-30  7:05 pull-request: can 2021-07-30 Marc Kleine-Budde
2021-07-30  7:05 ` [PATCH net 1/6] MAINTAINERS: add Yasushi SHOJI as reviewer for the Microchip CAN BUS Analyzer Tool driver Marc Kleine-Budde
2021-07-30  7:05 ` [PATCH net 2/6] can: hi311x: fix a signedness bug in hi3110_cmd() Marc Kleine-Budde
2021-07-30  7:05 ` Marc Kleine-Budde [this message]
2021-07-30  7:05 ` [PATCH net 4/6] can: usb_8dev: fix memory leak Marc Kleine-Budde
2021-07-30 17:32   ` Jakub Kicinski
2021-07-30  7:05 ` [PATCH net 5/6] can: ems_usb: " Marc Kleine-Budde
2021-07-30  7:05 ` [PATCH net 6/6] can: esd_usb2: " Marc Kleine-Budde
2021-07-30 17:33 ` pull-request: can 2021-07-30 Jakub Kicinski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \ \
    --subject='Re: [PATCH net 3/6] can: mcba_usb_start(): add missing urb->transfer_dma initialization' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).