]> git.baikalelectronics.ru Git - kernel.git/commit
net: kcm: Replace fput with sockfd_put
authorZheng Yongjun <zhengyongjun3@huawei.com>
Wed, 30 Dec 2020 09:18:09 +0000 (17:18 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 6 Jan 2021 00:02:32 +0000 (16:02 -0800)
commit841e7675db093538485fc9d6a86f739052028624
treed81e62bff46976ba75f9bac32d7d5055792f2d85
parent585956fae41b5ae01b5de5e9d503d3fb99ddbf28
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: Zheng Yongjun <zhengyongjun3@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/kcm/kcmsock.c