Message ID | 582379a6-dea3-482f-86e4-259d4b23204e@web.de (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | [v2] sysctl: Reduce dput(child) calls in proc_sys_fill_cache() | expand |
diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c index 9b9dfc450cb3..b277a1ca392e 100644 --- a/fs/proc/proc_sysctl.c +++ b/fs/proc/proc_sysctl.c @@ -698,11 +698,11 @@ static bool proc_sys_fill_cache(struct file *file, res = d_splice_alias(inode, child); d_lookup_done(child); if (unlikely(res)) { - if (IS_ERR(res)) { - dput(child); - return false; - } dput(child); + + if (IS_ERR(res)) + return false; + child = res; } }