• Jason A. Donenfeld's avatar
    netlink: put module reference if dump start fails · b87b6194
    Jason A. Donenfeld authored
    Before, if cb->start() failed, the module reference would never be put,
    because cb->cb_running is intentionally false at this point. Users are
    generally annoyed by this because they can no longer unload modules that
    leak references. Also, it may be possible to tediously wrap a reference
    counter back to zero, especially since module.c still uses atomic_inc
    instead of refcount_inc.
    
    This patch expands the error path to simply call module_put if
    cb->start() fails.
    
    Fixes: 41c87425 ("netlink: do not set cb_running if dump's start() errs")
    Signed-off-by: default avatarJason A. Donenfeld <Jason@zx2c4.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    b87b6194
Name
Last commit
Last update
..
Kconfig Loading commit data...
Makefile Loading commit data...
af_netlink.c Loading commit data...
af_netlink.h Loading commit data...
diag.c Loading commit data...
genetlink.c Loading commit data...