Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2502708imm; Mon, 24 Sep 2018 05:34:01 -0700 (PDT) X-Google-Smtp-Source: ACcGV60VtVOeidB+YeF7kM5YZgrh2SvMEVuFSaA4TrrA+qkuDjLyS3pjowUUICTVjTIY+4MHaDXP X-Received: by 2002:a63:5321:: with SMTP id h33-v6mr9318588pgb.139.1537792440993; Mon, 24 Sep 2018 05:34:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537792440; cv=none; d=google.com; s=arc-20160816; b=as4ZEcIu1zx05hK9ZUFF5hKtOK2ymNJ+Jn+LpzbcNzCZ1Hsa4l1Nrzat/zj7yaW8SU s8EgXMu9QEPRCnL75TrdpkCYJX0rXAWmsUuc5V9LcTei1GBN5+wrlxhg2LoDmEy18rPG xS1XHRQ683nTSVi6Lj3JFlG7QlRGBYjYbXuZEjnLjxHVySGpzH0HJDy/AgwvkUxh2puh hOFcnJHnSoXAO2jOtY75nUb/9K1EYtnckVQtcEUILYWYsqBOMQpA7SE3LXPipHX8PFHG gMHOu3NY+l4lGonPT6x33qheftuwzQKVR18sZboUV8Z7PA0+ifpGfzW+tEsvJ+AzRW1I A0tQ== 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; bh=IMNSRJZIFpmQjwr9a7JvaPtt6n1E/n2qCm3SMtEuXCs=; b=blv4sQ9ghN+ZDw49dmXagMg+1dtfEgAxxjVSY3rj8ha6L9kp+3Jg/ubGpxz8oxSTQd Q6SvRbvq6IcgXfNUoft0T0dVyk7WfyilOL0YYg8T/SmSl1s1e7ygw8yxnYJ8nW8USj8h I0PbPurGO1Qg6lv9jb5m85IFrtO5ktu1dWmYSAdDB7K2dgQzqLVV009xI5IO4pp5GGu7 fZD6KtCcgzIShwSQHOgWzuceevBIFIkc7ff0tBUAmKveUiPusgU3jsSJLGvPPRYsKTl7 eutf8eSXNBkWLC9XV/HJGVRlVYMFp/uEJAnMxXy1dhU4897b+8HrTwOD68b/q81/pRDn 6JvA== 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 p24-v6si34613566plo.52.2018.09.24.05.33.45; Mon, 24 Sep 2018 05:34:00 -0700 (PDT) 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 S2388137AbeIXSeY (ORCPT + 99 others); Mon, 24 Sep 2018 14:34:24 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:58178 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387409AbeIXSeX (ORCPT ); Mon, 24 Sep 2018 14:34:23 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id CFD8C1018; Mon, 24 Sep 2018 12:32:27 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Michael=20M=C3=BCller?= , Herbert Xu , Sasha Levin Subject: [PATCH 4.18 093/235] crypto: sharah - Unregister correct algorithms for SAHARA 3 Date: Mon, 24 Sep 2018 13:51:19 +0200 Message-Id: <20180924113114.506576695@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180924113103.999624566@linuxfoundation.org> References: <20180924113103.999624566@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review 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 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Michael Müller [ Upstream commit 0e7d4d932ffc23f75efb31a8c2ac2396c1b81c55 ] This patch fixes two typos related to unregistering algorithms supported by SAHARAH 3. In sahara_register_algs the wrong algorithms are unregistered in case of an error. In sahara_unregister_algs the wrong array is used to determine the iteration count. Signed-off-by: Michael Müller Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/crypto/sahara.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/crypto/sahara.c +++ b/drivers/crypto/sahara.c @@ -1351,7 +1351,7 @@ err_sha_v4_algs: err_sha_v3_algs: for (j = 0; j < k; j++) - crypto_unregister_ahash(&sha_v4_algs[j]); + crypto_unregister_ahash(&sha_v3_algs[j]); err_aes_algs: for (j = 0; j < i; j++) @@ -1367,7 +1367,7 @@ static void sahara_unregister_algs(struc for (i = 0; i < ARRAY_SIZE(aes_algs); i++) crypto_unregister_alg(&aes_algs[i]); - for (i = 0; i < ARRAY_SIZE(sha_v4_algs); i++) + for (i = 0; i < ARRAY_SIZE(sha_v3_algs); i++) crypto_unregister_ahash(&sha_v3_algs[i]); if (dev->version > SAHARA_VERSION_3)