Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4964023imu; Tue, 15 Jan 2019 08:52:38 -0800 (PST) X-Google-Smtp-Source: ALg8bN4DOEiM0RiVofAjzOEu1ebUIRmQXeWzjzEeTJbSblltTTynIrfkK3dunhLLkOXZ4P5lTDEG X-Received: by 2002:a62:2fc3:: with SMTP id v186mr4996165pfv.82.1547571158469; Tue, 15 Jan 2019 08:52:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547571158; cv=none; d=google.com; s=arc-20160816; b=VsLDWdpmiqnoY8Ptar2ACL82k0NcVJ5yCAxWjnrHRd3RnMayv6sqRg9A+gjWb69KYf 0MdBIZnIUSIGqVs2vkp+9wzgm83w/VR3wh5N3wXB2FU9n669tiaLwhOEtjV+UiWegV54 +BKdJYUDqXb3cDsWosl83fO0mcr1sTVV1lcAqVJ9j595/zq/c196w5Qk5CvLz/vj8bMf mcS5cadWdUELOYFs/TDf03Taz1BPSunalfAzJ6weoQ5hE30S4+pSvZ1kQBgnUBamoKvb 1c+/dTFmEUgRpjqedWP8neEBkV6hJ9fCFMkgYALZmLP4zgJp2DZoH+DDyePtAfX0/vSO 5qJA== 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=PNZlbNe78kv7Z8mP0pDi6g49M8/l3sG5mZeiorW38YQqpnOIClywKU2TjFIUp5VwWu M5r4SdO5kENIXzJvb6H24B5eKknzOzLT6I01/dczQCOM6GdpTG4+f8rKmkOolHINNfGB ZyPcoS9gzes1eKCiwRJEtWFkBVyxLCcbwq4xGxl8sunv1P53hKFuY5t0RtrYVcwzluCl gacako3qpUG04Zhg7U58nqzTbHbB1i+ALHRyBOuBf0o5vhvaaVhmD02/yCfizUL7jyKy gHi06xau/Z0EiissqgWxNj9N1Enh7XJDbHXo8JAlmuOv1d4heOFXPs0ol8DkGAoLpAHj dEIw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 123si3924955pfx.109.2019.01.15.08.52.22; Tue, 15 Jan 2019 08:52:38 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729968AbfAONoM (ORCPT + 99 others); Tue, 15 Jan 2019 08:44:12 -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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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(-) 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) { -- 2.20.1