Skip to content

Commit 4295c60

Browse files
committed
apparmor: Fix uninitialized symbol 'array_size' in policy_unpack_test.c
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 <[email protected]> Signed-off-by: John Johansen <[email protected]>
1 parent f6c64dc commit 4295c60

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

security/apparmor/policy_unpack_test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ static void policy_unpack_test_inbounds_when_out_of_bounds(struct kunit *test)
140140
static void policy_unpack_test_unpack_array_with_null_name(struct kunit *test)
141141
{
142142
struct policy_unpack_fixture *puf = test->priv;
143-
u16 array_size;
143+
u16 array_size = 0;
144144

145145
puf->e->pos += TEST_ARRAY_BUF_OFFSET;
146146

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

160160
puf->e->pos += TEST_NAMED_ARRAY_BUF_OFFSET;
161161

0 commit comments

Comments
 (0)