]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ethtool: module: avoid leaking a netdev ref on module flash errors
authorJakub Kicinski <kuba@kernel.org>
Fri, 22 May 2026 23:13:05 +0000 (16:13 -0700)
committerJakub Kicinski <kuba@kernel.org>
Tue, 26 May 2026 15:19:32 +0000 (08:19 -0700)
commitfb7f511d62692661846c47f199e0afe25c2982db
tree777a96be64e0c98fd1c669f6526cc501e5d180fa
parent84371fb58423f997939aacdcbc02d128d76a54e5
ethtool: module: avoid leaking a netdev ref on module flash errors

module_flash_fw_schedule() is missing undo for setting
the "in_progress" flag and taking the netdev reference.
Delay taking these, the device can't disappear while
we are holding rtnl_lock.

Fixes: 32b4c8b53ee7 ("ethtool: Add ability to flash transceiver modules' firmware")
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Reviewed-by: Danielle Ratson <danieller@nvidia.com>
Link: https://patch.msgid.link/20260522231312.1710836-3-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ethtool/module.c