From patchwork Fri Aug 25 13:47:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Lamparter X-Patchwork-Id: 9922053 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CABD26022E for ; Fri, 25 Aug 2017 13:47:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BDC5D28174 for ; Fri, 25 Aug 2017 13:47:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B2724281F9; Fri, 25 Aug 2017 13:47:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B24728174 for ; Fri, 25 Aug 2017 13:47:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755777AbdHYNr3 (ORCPT ); Fri, 25 Aug 2017 09:47:29 -0400 Received: from mail-wr0-f196.google.com ([209.85.128.196]:34743 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755031AbdHYNr2 (ORCPT ); Fri, 25 Aug 2017 09:47:28 -0400 Received: by mail-wr0-f196.google.com with SMTP id y14so667163wrd.1 for ; Fri, 25 Aug 2017 06:47:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=UJszwCfPdj4Cq7sWuiMe3P6nKjnhjjjPHI+NiQU6MYc=; b=uXtAw2k22lqHMafsNopxewGTlJpRxiiyDdkJbbsf7cIp0hluapjVpXUvZF5L3HpM7w 5AZCiKShZ6vxEHIjlnM/693NM9XvA4+Vidvsd4j2lfg2RELwjgNQm2ZQx/BwuZjPy7eQ Pu7ZbM38ryFJLFp5DGySm/kBk4rHFmb53SBRMgEcG8bqXOLDBJ1SErn7EAVcNJGM89n9 0OxDc/irhEbce7HtZNem7qRZESoSh86krmgKpZc1popbVrkIJkoPLh6mmeiws3xzQ+16 renuVR3A0Qoh4c6gargqqww5DW6S7zOSgj+bQUHDA/Lf3NIP/APulGqxHgCtnntngkUZ U2zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=UJszwCfPdj4Cq7sWuiMe3P6nKjnhjjjPHI+NiQU6MYc=; b=IrzbZpGhNrWEYYFKwjDHvYEmMl7lxs88YmACe0FAogt33VhPaF2zZ6ZVP1v6KwzlJo cXjATlEeudve/1E2BHIRuHGeOuuL2TEPMEiwm57KSd0voQjiFaFmogRjbKTJd1T/n67q 6BE4H3rNDFcQQ5Mdt/nAOnyoUXrrLkpzT6ybPPPWT8/aWoP1g4OcH2Unlly1coeKWD9M 1TpXSYbQhC9OXPmwUlpehSk8SLk6amgdcfpOh5iVhBOkccvL+8tfHge5iOaFJi9A0I5s GYfPX1l+CXpCE2YdLnX0kUZXcMtSKITRrbT+qoyK/+s3Gu6lQ5sD+uP+wv2Cc/VvzEVY gGFQ== X-Gm-Message-State: AHYfb5iFCFS1I+7ncghb4cIzA9d3RXE2rdVoREJi0WmKzKFry3BOsktm FZVHx/NzA9vFANUe X-Received: by 10.223.160.117 with SMTP id l50mr6025424wrl.31.1503668846882; Fri, 25 Aug 2017 06:47:26 -0700 (PDT) Received: from debian64.daheim (p200300D5FBC232FCD63D7EFFFEBDE96E.dip0.t-ipconnect.de. [2003:d5:fbc2:32fc:d63d:7eff:febd:e96e]) by smtp.gmail.com with ESMTPSA id m127sm1493440wmm.46.2017.08.25.06.47.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Aug 2017 06:47:25 -0700 (PDT) Received: from chuck by debian64.daheim with local (Exim 4.89) (envelope-from ) id 1dlExJ-00029C-9u; Fri, 25 Aug 2017 15:47:25 +0200 From: Christian Lamparter To: linux-crypto@vger.kernel.org Cc: Herbert Xu , David Miller Subject: [PATCH 01/12] crypto: crypto4xx: remove bad list_del Date: Fri, 25 Aug 2017 15:47:14 +0200 Message-Id: <71020bd2e3f4100c3c0668a13fdad9d22c8884a7.1503668705.git.chunkeey@googlemail.com> X-Mailer: git-send-email 2.14.1 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP alg entries are only added to the list, after the registration was successful. If the registration failed, it was never added to the list in the first place. Signed-off-by: Christian Lamparter --- drivers/crypto/amcc/crypto4xx_core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/amcc/crypto4xx_core.c b/drivers/crypto/amcc/crypto4xx_core.c index 65dc78b91dea..3118cec0d81e 100644 --- a/drivers/crypto/amcc/crypto4xx_core.c +++ b/drivers/crypto/amcc/crypto4xx_core.c @@ -1033,12 +1033,10 @@ int crypto4xx_register_alg(struct crypto4xx_device *sec_dev, break; } - if (rc) { - list_del(&alg->entry); + if (rc) kfree(alg); - } else { + else list_add_tail(&alg->entry, &sec_dev->alg_list); - } } return 0;