Commit 9c738dae authored by Markus Elfring's avatar Markus Elfring Committed by Joel Granados
Browse files

sysctl: Reduce dput(child) calls in proc_sys_fill_cache()



Replace two dput(child) calls with one that occurs immediately before
the IS_ERR evaluation. This transformation can be performed because
dput() gets called regardless of the value returned by IS_ERR(res).

This issue was transformed by using a script for the
semantic patch language like the following.
<SmPL>
@extended_adjustment@
expression e, f != { mutex_unlock }, x, y;
@@
+f(e);
 if (...)
 {
 <+... when != \( e = x \| y(..., &e, ...) \)
-   f(e);
 ...+>
 }
-f(e);
</SmPL>

Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
Reviewed-by: default avatarJoel Granados <joel.granados@kernel.org>
Signed-off-by: default avatarJoel Granados <joel.granados@kernel.org>
parent a883f2ef
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment