summaryrefslogtreecommitdiff
path: root/security
diff options
context:
space:
mode:
authorMinghao Chi <chi.minghao@zte.com.cn>2022-01-12 08:03:56 +0000
committerJohn Johansen <john.johansen@canonical.com>2022-07-09 15:13:59 -0700
commit84117994bc103617787147b8538a5c021b2ca79f (patch)
treeeab8d35071747a94404317fab06b7761fc9b6435 /security
parent68ff8540cc9e4ab557065b3f635c1ff4c96e1f1c (diff)
security/apparmor: remove redundant ret variable
Return value from nf_register_net_hooks() directly instead of taking this in another redundant variable. Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn> Signed-off-by: CGEL ZTE <cgel.zte@gmail.com> Signed-off-by: John Johansen <john.johansen@canonical.com>
Diffstat (limited to 'security')
-rw-r--r--security/apparmor/lsm.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
index 301c2bba4867..1ebcf1a6e1d0 100644
--- a/security/apparmor/lsm.c
+++ b/security/apparmor/lsm.c
@@ -1825,11 +1825,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)