diff mbox series

apparmor: Add __init annotation to aa_{setup/teardown}_dfa_engine()

Message ID 20221029012505.227136-1-xiujianfeng@huawei.com (mailing list archive)
State Handled Elsewhere
Headers show
Series apparmor: Add __init annotation to aa_{setup/teardown}_dfa_engine() | expand

Commit Message

xiujianfeng Oct. 29, 2022, 1:25 a.m. UTC
The aa_setup_dfa_engine() and aa_teardown_dfa_engine() is only called in
apparmor_init(), so let us add __init annotation to them.

Fixes: 11c236b89d7c ("apparmor: add a default null dfa")
Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
---
 security/apparmor/match.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

John Johansen Nov. 1, 2022, 12:35 p.m. UTC | #1
On 10/28/22 18:25, Xiu Jianfeng wrote:
> The aa_setup_dfa_engine() and aa_teardown_dfa_engine() is only called in
> apparmor_init(), so let us add __init annotation to them.
> 
> Fixes: 11c236b89d7c ("apparmor: add a default null dfa")
> Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>

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

I have pulled this into my tree


> ---
>   security/apparmor/match.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/security/apparmor/match.c b/security/apparmor/match.c
> index 5095c26ca683..b97ef5e1db73 100644
> --- a/security/apparmor/match.c
> +++ b/security/apparmor/match.c
> @@ -31,7 +31,7 @@ static char stacksplitdfa_src[] = {
>   };
>   struct aa_dfa *stacksplitdfa;
>   
> -int aa_setup_dfa_engine(void)
> +int __init aa_setup_dfa_engine(void)
>   {
>   	int error;
>   
> @@ -59,7 +59,7 @@ int aa_setup_dfa_engine(void)
>   	return 0;
>   }
>   
> -void aa_teardown_dfa_engine(void)
> +void __init aa_teardown_dfa_engine(void)
>   {
>   	aa_put_dfa(stacksplitdfa);
>   	aa_put_dfa(nulldfa);
diff mbox series

Patch

diff --git a/security/apparmor/match.c b/security/apparmor/match.c
index 5095c26ca683..b97ef5e1db73 100644
--- a/security/apparmor/match.c
+++ b/security/apparmor/match.c
@@ -31,7 +31,7 @@  static char stacksplitdfa_src[] = {
 };
 struct aa_dfa *stacksplitdfa;
 
-int aa_setup_dfa_engine(void)
+int __init aa_setup_dfa_engine(void)
 {
 	int error;
 
@@ -59,7 +59,7 @@  int aa_setup_dfa_engine(void)
 	return 0;
 }
 
-void aa_teardown_dfa_engine(void)
+void __init aa_teardown_dfa_engine(void)
 {
 	aa_put_dfa(stacksplitdfa);
 	aa_put_dfa(nulldfa);