lkml.org 
[lkml]   [2021]   [Jan]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v3 net-next] net: kcm: Replace fput with sockfd_put
From
From: Zheng Yongjun <zhengyongjun3@huawei.com>
Date: Wed, 30 Dec 2020 17:18:09 +0800

> 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>

Applied.

\
 
 \ /
  Last update: 2021-01-06 01:04    [W:0.028 / U:3.872 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site