summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2020-08-04 13:22:38 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2020-08-04 13:22:38 -0700
commit19a93823cf63d44d04c7571152087f12cb2199e6 (patch)
treeab6ce4faa8f7bf8d2acee29da0876cf32b530aa8
parentc0842fbc1b18c7a044e6ff3e8fa78bfa822c7d1a (diff)
parentfd49e03280e596e54edb93a91bc96170f8e97e4a (diff)
downloadlinux-19a93823cf63d44d04c7571152087f12cb2199e6.tar.bz2
Merge tag 'pstore-v5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux
Pull pstore update from Kees Cook: "A tiny pstore update which fixes a very corner-case build failure: - Fix linking when crypto API disabled (Matteo Croce)" * tag 'pstore-v5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: pstore: Fix linking when crypto API disabled
-rw-r--r--fs/pstore/platform.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c
index a9e297eefdff..36714df37d5d 100644
--- a/fs/pstore/platform.c
+++ b/fs/pstore/platform.c
@@ -269,6 +269,9 @@ static int pstore_compress(const void *in, void *out,
{
int ret;
+ if (!IS_ENABLED(CONFIG_PSTORE_COMPRESSION))
+ return -EINVAL;
+
ret = crypto_comp_compress(tfm, in, inlen, out, &outlen);
if (ret) {
pr_err("crypto_comp_compress failed, ret = %d!\n", ret);
@@ -668,7 +671,7 @@ static void decompress_record(struct pstore_record *record)
int unzipped_len;
char *unzipped, *workspace;
- if (!record->compressed)
+ if (!IS_ENABLED(CONFIG_PSTORE_COMPRESSION) || !record->compressed)
return;
/* Only PSTORE_TYPE_DMESG support compression. */