summaryrefslogtreecommitdiff
path: root/scripts/trace/git@git.tavy.me:linux-stable.git
diff options
context:
space:
mode:
authorFan Wu <fanwu01@zju.edu.cn>2026-07-09 16:41:59 +0000
committerMarc Kleine-Budde <mkl@pengutronix.de>2026-07-14 10:59:53 +0200
commitc43122fef328a70045fe7621c06de6b2b8e19264 (patch)
treeb379c0dc190b6faec7fd6861784dd6aa7cf94c0f /scripts/trace/git@git.tavy.me:linux-stable.git
parent79adf48fb091e32ed94113d919908be20e09f5eb (diff)
can: esd_usb: kill anchored URBs before freeing netdevs
esd_usb_disconnect() frees each CAN netdev with free_candev() inside its per-netdev loop and only calls unlink_all_urbs(dev) afterwards. The per-netdev private data (struct esd_usb_net_priv) is embedded in the net_device allocation returned by alloc_candev(), so once free_candev() has run, dev->nets[i] points to freed memory. unlink_all_urbs() then dereferences the freed dev->nets[i] to kill the per-netdev TX anchor (usb_kill_anchored_urbs(&priv->tx_submitted)), clear active_tx_jobs, and reset priv->tx_contexts[]. Reorder the teardown so the anchored URBs are killed before the netdevs are freed, matching other CAN/USB drivers in the same directory such as ems_usb, usb_8dev and mcba_usb, which unregister, then unlink, then free: unregister the netdevs first (which stops their TX queues), call unlink_all_urbs(dev) once, then free the netdevs. This issue was found by an in-house static analysis tool. Fixes: 96d8e90382dc ("can: Add driver for esd CAN-USB/2 device") Cc: stable@vger.kernel.org Assisted-by: Codex:gpt-5.5 Signed-off-by: Fan Wu <fanwu01@zju.edu.cn> Link: https://patch.msgid.link/20260709164159.497640-1-fanwu01@zju.edu.cn Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'scripts/trace/git@git.tavy.me:linux-stable.git')
0 files changed, 0 insertions, 0 deletions