Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5547058imm; Sun, 26 Aug 2018 23:10:58 -0700 (PDT) X-Google-Smtp-Source: ANB0VdauY9lFenlmaMhr85U79nr+dngwnyVyTtYhPbv/Sf0QMv/A4o6ZqhquT7GHSvyVApWHqonL X-Received: by 2002:a62:41d6:: with SMTP id g83-v6mr12847469pfd.219.1535350257968; Sun, 26 Aug 2018 23:10:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535350257; cv=none; d=google.com; s=arc-20160816; b=b6Q8nx5tGKsF+098AWdlUJbP31VY+51InnuNUX7SM5IzbnU7pNBInlnVBgPQUtAFTF J2u3f+NFuWAzodhLaab9kQOjoqDR0O2R28HEg7UF5BsulRPU3UAD3yoF0XbdcU6Cg8gp esTy6Sx3Njg+zrdBm2FhfhSD1rFFZ/n1U1M+i8qoNUsv0KSlSYBCMdO6gNCygj8zPXI0 l/AbaAVkklrETCvb4BrlsenmQ2PAH9w0SnT/lu5DJeW62IjtQrm61W3dsZ8SwcmU7RO5 M/JlpRbVGPnQ6DIELRg56L9AF1uwL+HRedHiEJQNRmKkDWo8ee9IQP76aNfZ0wuHnFc2 Ix2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=uS+au5AVLU7ZkfqdTz+HIUElnTWPdJPl3Yonp4QTo70=; b=BeLAuToSj7pb0Brv0V5p4A7BhL/kxVWAoqp82c+4UVhdWzHIBHJX3HHMMI5DhdhG0S zJrkDUtOdXbo67nAzGA0+zmzphde+gvvHRczweY3SgYWor2ZGxk+NaUuDU8fPSoTeWbl llMrmPPn36brpaHfSqmn8YNZj01IiafvCOGaHejcXN/9TK+iBcGHkkfo94XNdEj/v1wd I/S0AcZW4gI/hvM7souqRkfiCUzOotYzZhxEX1+2CLLAXXyhTGzIseiqCbL1UmhYuIuM pEyOHm5OkjcwJHrUeUxNudP27638dQ5dmx/UtmMx/nGLhIX8zSoCosTh9FJXbqUlL5JM QqMA== 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 y3-v6si13590508pgi.338.2018.08.26.23.10.42; Sun, 26 Aug 2018 23:10:57 -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 S1726977AbeH0Jyu (ORCPT + 99 others); Mon, 27 Aug 2018 05:54:50 -0400 Received: from orcrist.hmeau.com ([104.223.48.154]:48200 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726776AbeH0Jyt (ORCPT ); Mon, 27 Aug 2018 05:54:49 -0400 Received: from gondobar.mordor.me.apana.org.au ([192.168.128.4] helo=gondobar) by deadmen.hmeau.com with esmtps (Exim 4.89 #2 (Debian)) id 1fuAiO-0003RX-Lz; Mon, 27 Aug 2018 14:09:28 +0800 Received: from herbert by gondobar with local (Exim 4.89) (envelope-from ) id 1fuAiF-00057S-1y; Mon, 27 Aug 2018 14:09:19 +0800 Date: Mon, 27 Aug 2018 14:09:19 +0800 From: Herbert Xu To: "Martin K. Petersen" Cc: Jeff.Lien@wdc.com, ard.biesheuvel@linaro.org, david.darrington@wdc.com, hch@infradead.org, jeff.furlong@wdc.com, linux-block@vger.kernel.org, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, tim.c.chen@linux.intel.com Subject: Re: [PATCH 1/4] crypto: Introduce notifier for new crypto algorithms Message-ID: <20180827060918.tfz7ljufqhlej4kq@gondor.apana.org.au> References: <20180825061205.ygrjjazkooqghrqy@gondor.apana.org.au> <20180826024006.13800-1-martin.petersen@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180826024006.13800-1-martin.petersen@oracle.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Aug 25, 2018 at 10:40:03PM -0400, Martin K. Petersen wrote: > > diff --git a/crypto/algapi.c b/crypto/algapi.c > index c0755cf4f53f..87abad3cc322 100644 > --- a/crypto/algapi.c > +++ b/crypto/algapi.c > @@ -361,15 +361,12 @@ static void crypto_wait_for_test(struct crypto_larval *larval) > err = crypto_probing_notify(CRYPTO_MSG_ALG_REGISTER, larval->adult); > if (err != NOTIFY_STOP) { > if (WARN_ON(err != NOTIFY_DONE)) > - goto out; > + return; > crypto_alg_tested(larval->alg.cra_driver_name, 0); > } > > err = wait_for_completion_killable(&larval->completion); > WARN_ON(err); > - > -out: > - crypto_larval_kill(&larval->alg); > } > > int crypto_register_alg(struct crypto_alg *alg) > @@ -390,6 +387,8 @@ int crypto_register_alg(struct crypto_alg *alg) > return PTR_ERR(larval); > > crypto_wait_for_test(larval); > + crypto_probing_notify(CRYPTO_MSG_ALG_LOADED, larval); > + crypto_larval_kill(&larval->alg); I see that you have moved the larval_kill call into the caller. This is a problem because there are two callers to wait_for_test. So it's probably best to leave it in wait_for_test and add the notify there. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt