Skip to content
Commit 8dc879a1 authored by Zheng Yongjun's avatar Zheng Yongjun Committed by David S. Miller
Browse files

net: kcm: Replace fput with sockfd_put



The function sockfd_lookup uses fget on the value that is stored in
the file field of the returned structure, so fput should ultimately be
applied to this value.  This can be done directly, but it seems better
to use the specific macro sockfd_put, which does the same thing.

Perform a source code refactoring by using the following semantic patch.

    // <smpl>
    @@
    expression s;
    @@

       s = sockfd_lookup(...)
       ...
    + sockfd_put(s);
    - fput(s->file);
    // </smpl>

Signed-off-by: default avatarZheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8407b231
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment