From: John Johansen <john.johansen@canonical.com>
To: cgel.zte@gmail.com
Cc: jmorris@namei.org, serge@hallyn.com,
linux-security-module@vger.kernel.org,
linux-kernel@vger.kernel.org,
Minghao Chi <chi.minghao@zte.com.cn>,
Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH] security/apparmor: remove redundant ret variable
Date: Fri, 14 Jan 2022 14:12:50 -0800 [thread overview]
Message-ID: <d5b23c25-971a-dc67-1f97-b70ccb2160a6@canonical.com> (raw)
In-Reply-To: <20220112080356.666999-1-chi.minghao@zte.com.cn>
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)
>
prev parent reply other threads:[~2022-01-14 22:13 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-01-12 8:03 [PATCH] security/apparmor: remove redundant ret variable cgel.zte
2022-01-14 22:12 ` John Johansen [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d5b23c25-971a-dc67-1f97-b70ccb2160a6@canonical.com \
--to=john.johansen@canonical.com \
--cc=cgel.zte@gmail.com \
--cc=chi.minghao@zte.com.cn \
--cc=jmorris@namei.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-security-module@vger.kernel.org \
--cc=serge@hallyn.com \
--cc=zealci@zte.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).