security/apparmor: remove redundant ret variable
Subsystems (2)
PATCH 1/1 security/apparmor: remove redundant ret variable
From: Minghao Chi <[email protected]>
Return value from nf_register_net_hooks() directly instead of taking this in another redundant variable.
Reported-by Zeal Robot <[email protected]>
Signed-off-by Minghao Chi <[email protected]>
Signed-off-by CGEL ZTE <[email protected]>
--- security/apparmor/lsm.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
security/apparmor/lsm.c +1 -4
@@ -1799,11 +1799,8 @@ static const struct nf_hook_ops apparmor_nf_ops[] = {static int __net_init apparmor_nf_register (struct net *net) { -int ret; - - ret =nf_register_net_hooks (net, apparmor_nf_ops, +return nf_register_net_hooks (net, apparmor_nf_ops,ARRAY_SIZE (apparmor_nf_ops)); -return ret; } static void __net_exit apparmor_nf_unregister(struct net *net)
Signature · 1 line
2.25.1
Quoted 8 lines · On 1/12/22 12:03 AM, [email protected] wrote:
From: Minghao Chi <[email protected]>
Return value from
nf_register_net_hooks()directly instead of taking this in another redundant variable.Reported-by Zeal Robot <[email protected]>Signed-off-by Minghao Chi <[email protected]>Signed-off-by CGEL ZTE <[email protected]>
Acked-by John Johansen <[email protected]>
I will pull this into my tree
Quoted 22 lines
--- security/apparmor/lsm.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)security/apparmor/lsm.c +1
-4@@ -1799,11 +1799,8 @@ static const struct nf_hook_ops apparmor_nf_ops[] = {static int __net_init apparmor_nf_register (struct net *net) { -int ret; - - ret =nf_register_net_hooks (net, apparmor_nf_ops, +return nf_register_net_hooks (net, apparmor_nf_ops,ARRAY_SIZE (apparmor_nf_ops)); -return ret; } static void __net_exit apparmor_nf_unregister(struct net *net)