Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp677836ybv; Thu, 13 Feb 2020 07:37:14 -0800 (PST) X-Google-Smtp-Source: APXvYqxVO5MilfkcjYY4QT5KtreUrRodL7i4V+iO+l2ezFBk1nSv0O3UPJUhhRdRg3pD0LRVFQhu X-Received: by 2002:a9d:65c1:: with SMTP id z1mr14415060oth.180.1581608234030; Thu, 13 Feb 2020 07:37:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581608234; cv=none; d=google.com; s=arc-20160816; b=a2vSZKqUhKBax7ca1rbJ5Lso7Zj2mINOi1iDBswht1TaDMpvg6w7/jlOnH+nokENPT pTR+ASXWtpt4CLX5dC6QFgtkhZo0bW6kQDTrneuTDjocLY4CR6BO7yaeM6amkNqcebP8 F7uXXMKrYggBiQLJ0ci34SYNVXntEvE/YGiBl4KToWaY3G8ewDyplxiJAjJhv2wktZsI ur/f4icQkqrfKx4U6PXhd+ufPIu+hbh2ZG+x0pqmDPbV5c+Q0HwLAuhCzsY8NQsB2VkJ xQ1GugsFEREn/zSuwJN5wUxWIcIPptV+pgPVXhARK9iimCGHxy1/pT8I2PnFct4CgDyY DTXw== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TNkMDI1dpzCe1eGs7bc1hB64HMGgENMmZGZ8op0GGIQ=; b=wMsNL2h+6X8z/CVeH1hhfI4jEmVPcMkw6iEQYpwX7KDqIMUr3xfYO8suLy4/aA3SkY l0OqitjkpRxcx1TV3pHWIbLpnUwa685tvv2gYw96KQVHgvCUELMLGM+7drIVk6u8zcOY IgQucaZh47+RJk3CBy5WE1kiuFZsr4nrL3Pf235tHjHnbqP+ikdSdwuW+xDUs2rM8zpM xwUwZNEOhBwIOza2yjjPG/7naMZLyqVUQe+JG1SlekcvgeSEnVztEK3Td3E3kADDtwXS OeaYLaidYX4UqBKnE49QCHeY6fVRwAvtfzg3L7Z+aY65P2jsHf/eUwyjIUtocJ7d5ybz GofQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QbSiQL1t; 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 t7si1202433otl.133.2020.02.13.07.37.01; Thu, 13 Feb 2020 07:37:14 -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; dkim=pass header.i=@kernel.org header.s=default header.b=QbSiQL1t; 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 S1729591AbgBMPbV (ORCPT + 99 others); Thu, 13 Feb 2020 10:31:21 -0500 Received: from mail.kernel.org ([198.145.29.99]:53068 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728479AbgBMP1w (ORCPT ); Thu, 13 Feb 2020 10:27:52 -0500 Received: from localhost (unknown [104.132.1.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EF3FB2168B; Thu, 13 Feb 2020 15:27:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581607672; bh=dHeL7CXV9VZmIwpyozwNJgQsEYNVcPDI375P/GphZS8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QbSiQL1tjWCFMmwDX066u/tCZfocOySVy+HgE7HkVfbqWHIh5T7P8ZJDQPlDM4H4y FtKTmA9GPyItuuBvSU62N9wG/2tEeajOMay0k80vMfxkZACZZtJVYNEM5bBhG0z11J JGGJtBAoGuRWBX7qTYH23oiSqYQZrpWnkqz9e/U4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jesper Nilsson , Lars Persson , Eric Biggers , Herbert Xu Subject: [PATCH 5.4 78/96] crypto: artpec6 - return correct error code for failed setkey() Date: Thu, 13 Feb 2020 07:21:25 -0800 Message-Id: <20200213151908.623473446@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200213151839.156309910@linuxfoundation.org> References: <20200213151839.156309910@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Eric Biggers commit b828f905904cd76424230c69741a4cabb0174168 upstream. ->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 Acked-by: Lars Persson Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- drivers/crypto/axis/artpec6_crypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- 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(s 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;