Skip to content
Commit 53991aed authored by John Johansen's avatar John Johansen
Browse files

apparmor: Fix unpack_profile() warn: passing zero to 'ERR_PTR'



unpack_profile() sets a default error on entry but this gets overridden
by error assignment by functions called in its body. If an error
check that was relying on the default value is triggered after one
of these error assignments then zero will be passed to ERR_PTR.

Fix this by setting up a default -EPROTO assignment in the error
path and while we are at it make sure the correct error is returned
in non-default cases.

Fixes: 217af7e2 ("apparmor: refactor profile rules and attachments")
Reported-by: default avatarkernel test robot <lkp@intel.com>
Signed-off-by: default avatarJohn Johansen <john.johansen@canonical.com>
parent ee21a175
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment