From patchwork Tue Jan 15 13:43:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gilad Ben-Yossef X-Patchwork-Id: 155666 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp4907266jaa; Tue, 15 Jan 2019 05:44:11 -0800 (PST) X-Google-Smtp-Source: ALg8bN4ExwthTJoMmloognhmsVCwXfdmQ6nurtKBVSS/Wt4UKQIWcX1vt5xJYB/VbrwXWjQxJSZg X-Received: by 2002:a63:960a:: with SMTP id c10mr3941455pge.106.1547559851793; Tue, 15 Jan 2019 05:44:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547559851; cv=none; d=google.com; s=arc-20160816; b=enHOu56EJHbqAklddzncKzks8mGX+wJ6vm83CQ9P9JKI01UT88xZThjMPeXZn5XEsr YY7zd5fZTwXEE143bC41jSWs99TiVigsV0jVbKolGafSZnRv0l8pvPWDkV9loZuvYd9o vcOE7X/5BiVMhFnHV6eCKTnNSKNvlHxcdCfuaLNt32WMMByDX1hK/M5fmBG2s2R8A5fd OJuiZ2YjbJj+h6oh4Iw/QANf+BDUR3LFE32YR6BIS4r1W0b3OjFX7pk3RbzN7J0i3THN v5DGWD3sk2dn5ggf4gsDYUiYbgmymyKk4P1vDHScLjG2KILiPphFshN0zGFXjF62BSSy ykqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=bmjBFgBqNJhCx9yGQVYBvVwCzvSUqi50att8gAVHrEE=; b=mim0bdmR3nP1stT84bOGaRXF+ZcfWEtemJGhEdbKbGb48oGq7vse2iqLWkuI+FO9Oy bn5GVO/pDo2UsreHeDLLr9TzItB1LSLzuIJ28xTyBUWE3Q/mEZDYD57x8Kl6OGYEkWL+ 9UvBiHqaidKXABTR1GHIbP+ooq3Y7ajF3L8WNxMAgelRQlY1TCKPPkIRh64wdAKdiYQh kVPfD6MpLMX1vM+td3YckmnGPp6hQQUsVRFEeHqtktFwuHwQx8TSoLFOU7hauey/NWNL jLWVVYbcLtbz0fnFAXYUXDe4Kn4nT8FaxttQ3dzmEyHT4W01oQoWkrkF/2iH4qTBIlaM ZxDg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f82si3410107pfa.221.2019.01.15.05.44.11; Tue, 15 Jan 2019 05:44:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728468AbfAONoK (ORCPT + 3 others); Tue, 15 Jan 2019 08:44:10 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:50736 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729844AbfAONni (ORCPT ); Tue, 15 Jan 2019 08:43:38 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8E5EBA78; Tue, 15 Jan 2019 05:43:38 -0800 (PST) Received: from e110176-lin.kfn.arm.com (e110176-lin.kfn.arm.com [10.50.4.178]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 0E3033F70D; Tue, 15 Jan 2019 05:43:36 -0800 (PST) From: Gilad Ben-Yossef To: Herbert Xu , "David S. Miller" Cc: Hadar Gat , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/7] crypto: ccree: add error message Date: Tue, 15 Jan 2019 15:43:12 +0200 Message-Id: <20190115134318.28712-3-gilad@benyossef.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190115134318.28712-1-gilad@benyossef.com> References: <20190115134318.28712-1-gilad@benyossef.com> MIME-Version: 1.0 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org From: Hadar Gat Add error message in case of too many mlli entries. Signed-off-by: Hadar Gat Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/ccree/cc_buffer_mgr.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.20.1 diff --git a/drivers/crypto/ccree/cc_buffer_mgr.c b/drivers/crypto/ccree/cc_buffer_mgr.c index 32d2df36ced2..237a87a57830 100644 --- a/drivers/crypto/ccree/cc_buffer_mgr.c +++ b/drivers/crypto/ccree/cc_buffer_mgr.c @@ -156,8 +156,11 @@ static int cc_render_buff_to_mlli(struct device *dev, dma_addr_t buff_dma, /* Verify there is no memory overflow*/ new_nents = (*curr_nents + buff_size / CC_MAX_MLLI_ENTRY_SIZE + 1); - if (new_nents > MAX_NUM_OF_TOTAL_MLLI_ENTRIES) + if (new_nents > MAX_NUM_OF_TOTAL_MLLI_ENTRIES) { + dev_err(dev, "Too many mlli entries. current %d max %d\n", + new_nents, MAX_NUM_OF_TOTAL_MLLI_ENTRIES); return -ENOMEM; + } /*handle buffer longer than 64 kbytes */ while (buff_size > CC_MAX_MLLI_ENTRY_SIZE) {