• Jakub Kicinski's avatar
    devlink: always check if the devlink instance is registered · ed539ba6
    Jakub Kicinski authored
    Always check under the instance lock whether the devlink instance
    is still / already registered.
    
    This is a no-op for the most part, as the unregistration path currently
    waits for all references. On the init path, however, we may temporarily
    open up a race with netdev code, if netdevs are registered before the
    devlink instance. This is temporary, the next change fixes it, and this
    commit has been split out for the ease of review.
    
    Note that in case of iterating over sub-objects which have their
    own lock (regions and line cards) we assume an implicit dependency
    between those objects existing and devlink unregistration.
    Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
    Reviewed-by: default avatarJiri Pirko <jiri@nvidia.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    ed539ba6
leftover.c 319 KB