ANDROID: crypto: keysetup: use FSCRYPT_MODE_MAX instead of __FSCRYPT_MODE_MAX

In 5.10.3 the commit 3b7c17a814 ("fscrypt: remove kernel-internal
constants from UAPI header") removes __FSCRYPT_MODE_MAX so we need to
fix up the out-of-tree crypto code in the android12-5.10 branch that
uses it to keep the build working properly.

Fixes: 3b7c17a814 ("fscrypt: remove kernel-internal constants from UAPI header")

Cc: Eric Biggers <ebiggers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I8e6dc371e46d37583c488ccdaec500c46a9734a8
This commit is contained in:
Greg Kroah-Hartman 2020-12-27 12:17:15 +01:00
parent 499df25c94
commit a7c33264f9

View File

@ -200,7 +200,7 @@ static int setup_per_mode_enc_key(struct fscrypt_info *ci,
err = -EINVAL;
goto out_unlock;
}
for (i = 0; i <= __FSCRYPT_MODE_MAX; i++) {
for (i = 0; i <= FSCRYPT_MODE_MAX; i++) {
if (fscrypt_is_key_prepared(&keys[i], ci)) {
fscrypt_warn(ci->ci_inode,
"Each hardware-wrapped key can only be used with one encryption mode");