linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] security/apparmor: remove redundant ret variable
@ 2022-01-12  8:03 cgel.zte
  2022-01-14 22:12 ` John Johansen
  0 siblings, 1 reply; 2+ messages in thread
From: cgel.zte @ 2022-01-12  8:03 UTC (permalink / raw)
  To: john.johansen
  Cc: jmorris, serge, linux-security-module, linux-kernel, Minghao Chi,
	Zeal Robot, CGEL ZTE

From: Minghao Chi <chi.minghao@zte.com.cn>

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>
---
 security/apparmor/lsm.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
index ce7d96627810..f3deeb8b712e 100644
--- a/security/apparmor/lsm.c
+++ b/security/apparmor/lsm.c
@@ -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)
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] security/apparmor: remove redundant ret variable
  2022-01-12  8:03 [PATCH] security/apparmor: remove redundant ret variable cgel.zte
@ 2022-01-14 22:12 ` John Johansen
  0 siblings, 0 replies; 2+ messages in thread
From: John Johansen @ 2022-01-14 22:12 UTC (permalink / raw)
  To: cgel.zte
  Cc: jmorris, serge, linux-security-module, linux-kernel, Minghao Chi,
	Zeal Robot

On 1/12/22 12:03 AM, cgel.zte@gmail.com wrote:
> From: Minghao Chi <chi.minghao@zte.com.cn>
> 
> 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>

Acked-by: John Johansen <john.johansen@canonical.com>

I will pull this into my tree

> ---
>  security/apparmor/lsm.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/security/apparmor/lsm.c b/security/apparmor/lsm.c
> index ce7d96627810..f3deeb8b712e 100644
> --- a/security/apparmor/lsm.c
> +++ b/security/apparmor/lsm.c
> @@ -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)
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-14 22:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-12  8:03 [PATCH] security/apparmor: remove redundant ret variable cgel.zte
2022-01-14 22:12 ` John Johansen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).