Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp14869123ybl; Mon, 30 Dec 2019 19:24:27 -0800 (PST) X-Google-Smtp-Source: APXvYqz12fMeDrA/WY60MWYz3K/E8MpgZ7ay3095Ibasg1ieJDPYzi66LsNvdAEu4gFgVOyBDYiR X-Received: by 2002:a9d:748d:: with SMTP id t13mr75266957otk.181.1577762667150; Mon, 30 Dec 2019 19:24:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577762667; cv=none; d=google.com; s=arc-20160816; b=Dkzq/Bf0oC6emIQHt80ZW7y47XG7LNmYlJhP2GfJt+kINKynD4qoow00ZR3LNdOYfp BIrN/uM+OAYJnAF1w4MFPhOwL9joZWbXLKp/ptPVl8v+2n8NfOMhe8AsCu6hRjMyXm7T Wkr0+hyc/7gZe7Gc4rk+jl3MAqyg8l8uei4qvKSsgITDXDcXdP3oadhc1uY4bAATR5jL Shsz0Ae3ONruYOtd8i+yhyThenbSPYiscEgf/ZEqedfQkvhjeQoE03DpgDNWsDsVSq8c 8bfNBFO59EENX65NVF94NTeT+wuH+ib12q6Q29mB74eB2P7/vATTPI0ilL0XQClHGM1b /osg== 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:to:from :dkim-signature; bh=F9NKa8vPYRqir7Tlg0no2WTq3xU0xTd8XoLNOFSpd9U=; b=ptlA+OvUT/6g9KZ3kL/vvGh+pESMTl5qZ7yaBWpYXQbqxlZb5MQrEzGjX6098448lE frIHWuAqPJbg4f2jW3YACM3+RgThxZxkRXsx4fPy67FGeJxKHXXT/YC+LRMomo7pY/Gv vmidyD1aB6Ia1cNc4XjtiKrcKoTq0FnR//BGTzkZmXKEfVDKEzMdQucxeMt3IpkScAMv /F110r8OU9MTuRRQsk+p45tXx5bG4dpTanSgM8bkizgFDC0a632V8cdap750zoMRqxMb v1sbg/bRnHdyz9mjZuDdoJ3D1IBIrS9xOLt5H2dTyAHykQhuXhk4Y2ALMPzz5WiJ4ifm VUVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uP3imjig; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l3si21180045otq.40.2019.12.30.19.24.01; Mon, 30 Dec 2019 19:24:27 -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; dkim=pass header.i=@kernel.org header.s=default header.b=uP3imjig; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726359AbfLaDUy (ORCPT + 99 others); Mon, 30 Dec 2019 22:20:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:59162 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726119AbfLaDUy (ORCPT ); Mon, 30 Dec 2019 22:20:54 -0500 Received: from zzz.tds (h75-100-12-111.burkwi.broadband.dynamic.tds.net [75.100.12.111]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0BECE20730 for ; Tue, 31 Dec 2019 03:20:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577762454; bh=wBNLBiJ2IXT7H2VAszSfeo4KEcW59oHXVPFI3eI/2gU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=uP3imjigg8Epcik/snokcoKw4HV1v2mkrKhiWux+JIo7Wzg9ddl1YB+WPflZgsD+6 G6rcSzeIvABKLDR99sxdw1yz6V23E9L2l7lqmGSdX1XZyAPpRbH+rfVac7mLM9So5I xZGhFLcujbPs3plvDWuI+/OMd76XNyAZiYE0tLcs= From: Eric Biggers To: linux-crypto@vger.kernel.org Subject: [PATCH 2/8] crypto: artpec6 - return correct error code for failed setkey() Date: Mon, 30 Dec 2019 21:19:32 -0600 Message-Id: <20191231031938.241705-3-ebiggers@kernel.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191231031938.241705-1-ebiggers@kernel.org> References: <20191231031938.241705-1-ebiggers@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org From: Eric Biggers ->setkey() is supposed to retun -EINVAL for invalid key lengths, not -1. Fixes: a21eb94fc4d3 ("crypto: axis - add ARTPEC-6/7 crypto accelerator driver") Cc: Jesper Nilsson Cc: Lars Persson Signed-off-by: Eric Biggers --- drivers/crypto/axis/artpec6_crypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/axis/artpec6_crypto.c b/drivers/crypto/axis/artpec6_crypto.c index 4b20606983a4..22ebe40f09f5 100644 --- a/drivers/crypto/axis/artpec6_crypto.c +++ b/drivers/crypto/axis/artpec6_crypto.c @@ -1251,7 +1251,7 @@ static int artpec6_crypto_aead_set_key(struct crypto_aead *tfm, const u8 *key, if (len != 16 && len != 24 && len != 32) { crypto_aead_set_flags(tfm, CRYPTO_TFM_RES_BAD_KEY_LEN); - return -1; + return -EINVAL; } ctx->key_length = len; -- 2.24.1