From patchwork Fri Aug 5 13:00:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Will Thomas X-Patchwork-Id: 9265379 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 782E360754 for ; Fri, 5 Aug 2016 13:08:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6B12F28426 for ; Fri, 5 Aug 2016 13:08:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5FE2128444; Fri, 5 Aug 2016 13:08:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 126D228426 for ; Fri, 5 Aug 2016 13:08:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161098AbcHENIS (ORCPT ); Fri, 5 Aug 2016 09:08:18 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:23440 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759709AbcHENIQ (ORCPT ); Fri, 5 Aug 2016 09:08:16 -0400 Received: from HHMAIL01.hh.imgtec.org (unknown [10.100.10.19]) by Forcepoint Email with ESMTPS id B9D4EF15CF9A2; Fri, 5 Aug 2016 14:08:00 +0100 (IST) Received: from will-ubuntu.kl.imgtec.org (192.168.167.83) by HHMAIL01.hh.imgtec.org (10.100.10.21) with Microsoft SMTP Server (TLS) id 14.3.294.0; Fri, 5 Aug 2016 14:08:03 +0100 From: Will Thomas To: CC: , Will Thomas Subject: [PATCH v2 7/7] crypto: img-hash - Fix set_reqsize call Date: Fri, 5 Aug 2016 14:00:20 +0100 Message-ID: <1470402020-10774-8-git-send-email-will.thomas@imgtec.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1470402020-10774-1-git-send-email-will.thomas@imgtec.com> References: <1470402020-10774-1-git-send-email-will.thomas@imgtec.com> MIME-Version: 1.0 X-Originating-IP: [192.168.167.83] Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Properly allocate enough memory to respect the fallback. Signed-off-by: Will Thomas --- drivers/crypto/img-hash.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/crypto/img-hash.c b/drivers/crypto/img-hash.c index 60410d7..a2e77b8 100644 --- a/drivers/crypto/img-hash.c +++ b/drivers/crypto/img-hash.c @@ -686,6 +686,7 @@ static int img_hash_cra_init(struct crypto_tfm *tfm, const char *alg_name) } crypto_ahash_set_reqsize(__crypto_ahash_cast(tfm), sizeof(struct img_hash_request_ctx) + + crypto_ahash_reqsize(ctx->fallback) + IMG_HASH_DMA_THRESHOLD); return 0;