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:kernel test robot <lkp@intel.com> Signed-off-by:
John Johansen <john.johansen@canonical.com>
Showing
Please register or sign in to comment