]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ethtool: module: call ethnl_ops_complete() on module flash errors
authorJakub Kicinski <kuba@kernel.org>
Fri, 22 May 2026 23:13:04 +0000 (16:13 -0700)
committerJakub Kicinski <kuba@kernel.org>
Tue, 26 May 2026 15:19:32 +0000 (08:19 -0700)
When validate() fails we are skipping over ethnl_ops_complete()
even tho we already called ethnl_ops_begin().

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-2-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ethtool/module.c

index cad2eb25b5a41435683522a60e254d9db050968e..741f6fb25d457f868beaddbcf8f0d7708b447988 100644 (file)
@@ -427,10 +427,11 @@ int ethnl_act_module_fw_flash(struct sk_buff *skb, struct genl_info *info)
 
        ret = ethnl_module_fw_flash_validate(dev, info->extack);
        if (ret < 0)
-               goto out_unlock;
+               goto out_complete;
 
        ret = module_flash_fw(dev, tb, skb, info);
 
+out_complete:
        ethnl_ops_complete(dev);
 
 out_unlock: