• Herbert Xu's avatar
    [NETLINK]: cb_lock does not needs ref count on sk · 96c36023
    Herbert Xu authored
    Here is a little optimisation for the cb_lock used by netlink_dump.
    While fixing that race earlier, I noticed that the reference count
    held by cb_lock is completely useless.  The reason is that in order
    to obtain the protection of the reference count, you have to take
    the cb_lock.  But the only way to take the cb_lock is through
    dereferencing the socket.
    
    That is, you must already possess a reference count on the socket
    before you can take advantage of the reference count held by cb_lock.
    As a corollary, we can remve the reference count held by the cb_lock.
    Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    96c36023
af_netlink.c 30.8 KB