error is initialized to -EPROTO but set by some of the internal
functions, unfortunately the last two checks assume error is set to
-EPROTO already for the failure case. Ensure it is by setting it
before these checks.
Fixes: 3d28e2397af7a ("apparmor: add support loading per permission tagging")
Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
*info = "failed to unpack profile tag.sets";
goto fail;
}
+ error = -EPROTO;
if (!aa_unpack_nameX(e, AA_STRUCTEND, NULL))
goto fail;