Skip to content

Commit

Permalink
apparmor: Fix uninitialized symbol 'array_size' in policy_unpack_test.c
Browse files Browse the repository at this point in the history
Make sure array_size is initialized in the kunit test to get rid of
compiler warnings. This will also make sure the following tests fail
consistently if the first test fails.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
  • Loading branch information
John Johansen committed Nov 2, 2022
1 parent f6c64dc commit 4295c60
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions security/apparmor/policy_unpack_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ static void policy_unpack_test_inbounds_when_out_of_bounds(struct kunit *test)
static void policy_unpack_test_unpack_array_with_null_name(struct kunit *test)
{
struct policy_unpack_fixture *puf = test->priv;
u16 array_size;
u16 array_size = 0;

puf->e->pos += TEST_ARRAY_BUF_OFFSET;

Expand All @@ -155,7 +155,7 @@ static void policy_unpack_test_unpack_array_with_name(struct kunit *test)
{
struct policy_unpack_fixture *puf = test->priv;
const char name[] = TEST_ARRAY_NAME;
u16 array_size;
u16 array_size = 0;

puf->e->pos += TEST_NAMED_ARRAY_BUF_OFFSET;

Expand Down

0 comments on commit 4295c60

Please sign in to comment.