aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2018-03-19 05:12:31 -0400
committerJohn Johansen <john.johansen@canonical.com>2018-03-23 20:28:38 -0400
commitd53c9f4d212c25b09670a71e2a993071d1e637a2 (patch)
tree187fbebda854a6541eb3f72bd316838779dc8a96
parenta61ecd329cfa951b7d36c13e9e2a07e7761c0e89 (diff)
apparmor: Fix an error code in verify_table_headers()
We accidentally return a positive EPROTO instead of a negative -EPROTO. Since 71 is not an error pointer, that means it eventually results in an Oops in the caller. Fixes: d901d6a298dc ("apparmor: dfa split verification of table headers") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: John Johansen <john.johansen@canonical.com>
-rw-r--r--security/apparmor/match.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/security/apparmor/match.c b/security/apparmor/match.c
index dd4c995c5e25..280eba082c7b 100644
--- a/security/apparmor/match.c
+++ b/security/apparmor/match.c
@@ -198,7 +198,7 @@ out:
198static int verify_dfa(struct aa_dfa *dfa) 198static int verify_dfa(struct aa_dfa *dfa)
199{ 199{
200 size_t i, state_count, trans_count; 200 size_t i, state_count, trans_count;
201 int error = EPROTO; 201 int error = -EPROTO;
202 202
203 state_count = dfa->tables[YYTD_ID_BASE]->td_lolen; 203 state_count = dfa->tables[YYTD_ID_BASE]->td_lolen;
204 trans_count = dfa->tables[YYTD_ID_NXT]->td_lolen; 204 trans_count = dfa->tables[YYTD_ID_NXT]->td_lolen;