Skip to content
Snippets Groups Projects
  1. Jan 14, 2025
  2. Oct 12, 2023
    • Jiri Pirko's avatar
      devlink: remove reload failed checks in params get/set callbacks · c2acbea8
      Jiri Pirko authored and Frieder Schrempf's avatar Frieder Schrempf committed
      
      [ Upstream commit 633d76ad ]
      
      The checks in question were introduced by:
      commit 6b4db2e5 ("devlink: Fix use-after-free after a failed reload").
      That fixed an issue of reload with mlxsw driver.
      
      Back then, that was a valid fix, because there was a limitation
      in place that prevented drivers from registering/unregistering params
      when devlink instance was registered.
      
      It was possible to do the fix differently by changing drivers to
      register/unregister params in appropriate places making sure the ops
      operate only on memory which is allocated and initialized. But that,
      as a dependency, would require to remove the limitation mentioned above.
      
      Eventually, this limitation was lifted by:
      commit 1d18bb1a ("devlink: allow registering parameters after the instance")
      
      Also, the alternative fix (which also fixed another issue) was done by:
      commit 74cbc3c0 ("mlxsw: spectrum_acl_tcam: Move devlink param to TCAM code").
      
      Therefore, the checks are no longer relevant. Each driver should make
      sure to have the params registered only when the memory the ops
      are working with is allocated and initialized.
      
      So remove the checks.
      
      Signed-off-by: default avatarJiri Pirko <jiri@nvidia.com>
      Reviewed-by: default avatarIdo Schimmel <idosch@nvidia.com>
      Reviewed-by: default avatarJakub Kicinski <kuba@kernel.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      c2acbea8
  3. Sep 11, 2023
Loading