Received: by 10.213.65.68 with SMTP id h4csp334588imn; Fri, 6 Apr 2018 00:36:33 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/QzjhFf28l+qrtB+YpugVSwtXAqxWXdjuJ9Rz+f5/4plXku6+Ish909IoDeDe9/BW0xvei X-Received: by 10.99.98.196 with SMTP id w187mr17290761pgb.307.1523000193231; Fri, 06 Apr 2018 00:36:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523000193; cv=none; d=google.com; s=arc-20160816; b=KTP9sKMXxh2KYC1eFLzsb+O85iKAmcwBQzfNtI9YKDyHBbSJkklA1JyNcpk+jPR+cn PvhYjjgovAoEdXRp3vS4tB7toY5QMaMAjFG0CVEROdBuWyFNq7f4mg6Bl5gLuuYZxcCp TdHMbIsJ4pPiwu/JeDbWjNGpWmJnL4wp1/QsiB5X+7EFW+MZgm/rRx5hE1Fi0vRtl7WB cdygHtIKsF/WO+QYsw0sY/H7MyDqTOD43pVou6pVvYsNP/RqQjJZD/AgWbXYpPOqiUDd lCnjJ3a9aDt8/0v9L99viMYbL8iHVenV9nB3OFsXsqNj1kjxzwZvV7dECL9kioxU9Bpt rvFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=yavyUbG0xAeUewwsnjsYKICngRjZEAibJJgFXUo6hDY=; b=jR5zil3tCCKi2KVDqyXS9iAVp8tnEq5pCwxrHxF8oX7PuAkE108dJvUTbCqbyrF+Wb sFbm7Mk6wQ0a6BN5ceQ7iIhEyYDnsIGSIwx1waUXbvprhZJWSKvs+q5OP9Yq7xRNo0bO 5GUDX3/yoqpbBBoiYPvyfx1orXXPkzR+Np7FhK9myMKdLEzZkde9CoYhlUNP5ZdRwtbO O9/NaY9MzV5Fd5FLK/9qKg/s8MZbw85arELvC9ifXZbxnpTmZC8kGNZ+ORvzhnPNZWyc f+yTQVO+MaLjJgAaNyJVzugS/b7WVNet3ZHanc/yqLTI39EC9EIBlcbaurBxQPdcxfrN FcyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Z5SFIqxj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z14si5610977pfe.289.2018.04.06.00.36.19; Fri, 06 Apr 2018 00:36:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Z5SFIqxj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751807AbeDFHeq (ORCPT + 99 others); Fri, 6 Apr 2018 03:34:46 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:56079 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751280AbeDFHeo (ORCPT ); Fri, 6 Apr 2018 03:34:44 -0400 Received: by mail-wm0-f66.google.com with SMTP id b127so1138707wmf.5 for ; Fri, 06 Apr 2018 00:34:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=yavyUbG0xAeUewwsnjsYKICngRjZEAibJJgFXUo6hDY=; b=Z5SFIqxj0nuk9Vdy2Y2X/XgrbZ41ItkhGjdZWYM4TNy1SLwXB5HcsqmEUZAjg95pyI Bg2OOprZQGgdzHMvqSlmE9hOhzrlwMuIjjAfYOiqWnH746lsiWUHJvK5ErYvbUCxhbwc /hR1+YL/T4onGnIF4foaw0grzcr0Jug9uA1p04gSWVSljL3WtOOelPn+zDdJyDEkFtcH bm4vaAV10P8IxMohvmqk7lmrEMflLVn/p5o54FBTdoR0IWdofjAPPzOGRiQtYHjoPKYB WXTTvZN7zWBh6uFyyEIG5vMVCbU0dO3tBWbrLDbnEc53/Xs+vMgGSZR2Aduj40Tufg0M hwOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=yavyUbG0xAeUewwsnjsYKICngRjZEAibJJgFXUo6hDY=; b=bGn6srqsfTKwEnLhrkwMLO2S5mjQU5dnDwvlMpzyN1jFYM/z/LPuH2Glck9jvcGTrN Hga0jSPw1JuHYFb21xgjypIqvkP3IbN/if25rB1jwMWrUjjPjber/kZvJgUFqzkrfn/i H1r1ZvOcIrvzb1rldq2XS7ky4bjZ53qgaWwCZFxWL0MU2PGc9rGFaDVlei83NSSGWUaZ jNPpeZpy9uux8Nue0Cd+sHP476WmLHbHqvtBahtNWysAtJi7iDZSCgNPxnDnsdfTXTfK uTnTtGxiF8jhKZyBNoz8tAQro97SpcMNV0yOCYOZBhNmdeeSBdSkxuqyMEK/hZoOmjMG 2Jbw== X-Gm-Message-State: ALQs6tAp8lXurRH5p6tAYO5CRPthKC13oBl/sKUcFdIYjLI89+2ZQ/Za L0NyJzrH4jYMom/qKqrCCYU= X-Received: by 10.28.249.8 with SMTP id x8mr11632214wmh.12.1523000083608; Fri, 06 Apr 2018 00:34:43 -0700 (PDT) Received: from [127.0.1.1] ([83.243.48.55]) by smtp.gmail.com with ESMTPSA id z133sm5654240wmg.28.2018.04.06.00.34.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Apr 2018 00:34:42 -0700 (PDT) From: Tobias Regnery To: keescook@chromium.org, arnd@arndb.de, linux-kernel@vger.kernel.org Cc: Tobias Regnery Subject: [PATCH v2] pstore: fix crypto dependencies without compression Date: Fri, 6 Apr 2018 09:25:17 +0200 Message-Id: <20180406072517.27709-1-tobias.regnery@gmail.com> X-Mailer: git-send-email 2.16.3 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 58eb5b670747 ("pstore: fix crypto dependencies") fixed up the crypto dependencies but missed the case when no compression is selected. With CONFIG_PSTORE=y, CONFIG_PSTORE_COMPRESS=n and CONFIG_CRYPTO=m we see the following link error: fs/pstore/platform.o: In function `pstore_register': (.text+0x1b1): undefined reference to `crypto_has_alg' (.text+0x205): undefined reference to `crypto_alloc_base' fs/pstore/platform.o: In function `pstore_unregister': (.text+0x3b0): undefined reference to `crypto_destroy_tfm' Fix this by checking at compile-time if CONFIG_PSTORE_COMPRESS is enabled. Fixes: 58eb5b670747 ("pstore: fix crypto dependencies") Signed-off-by: Tobias Regnery --- v2: check the config at compile-time rather than change the kconfig-dependency as suggested by Arnd. --- fs/pstore/platform.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c index 1143ef351c58..dc720573fd53 100644 --- a/fs/pstore/platform.c +++ b/fs/pstore/platform.c @@ -258,7 +258,7 @@ static int pstore_decompress(void *in, void *out, static void allocate_buf_for_compression(void) { - if (!zbackend) + if (!IS_ENABLED(CONFIG_PSTORE_COMPRESS) || !zbackend) return; if (!crypto_has_comp(zbackend->name, 0, 0)) { @@ -287,7 +287,7 @@ static void allocate_buf_for_compression(void) static void free_buf_for_compression(void) { - if (!IS_ERR_OR_NULL(tfm)) + if (IS_ENABLED(CONFIG_PSTORE_COMPRESS) && !IS_ERR_OR_NULL(tfm)) crypto_free_comp(tfm); kfree(big_oops_buf); big_oops_buf = NULL; -- 2.16.3