mirror of
https://github.com/torvalds/linux.git
synced 2026-06-03 12:03:54 +02:00
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: 32b4c8b53e ("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>
This commit is contained in:
parent
84371fb584
commit
fb7f511d62
|
|
@ -319,8 +319,6 @@ module_flash_fw_schedule(struct net_device *dev, const char *file_name,
|
|||
if (err < 0)
|
||||
goto err_release_firmware;
|
||||
|
||||
dev->ethtool->module_fw_flash_in_progress = true;
|
||||
netdev_hold(dev, &module_fw->dev_tracker, GFP_KERNEL);
|
||||
fw_update->dev = dev;
|
||||
fw_update->ntf_params.portid = info->snd_portid;
|
||||
fw_update->ntf_params.seq = info->snd_seq;
|
||||
|
|
@ -335,6 +333,9 @@ module_flash_fw_schedule(struct net_device *dev, const char *file_name,
|
|||
if (err < 0)
|
||||
goto err_release_firmware;
|
||||
|
||||
dev->ethtool->module_fw_flash_in_progress = true;
|
||||
netdev_hold(dev, &module_fw->dev_tracker, GFP_KERNEL);
|
||||
|
||||
schedule_work(&module_fw->work);
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user