Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp5298715rwb; Wed, 7 Sep 2022 00:01:30 -0700 (PDT) X-Google-Smtp-Source: AA6agR5btRlJNIRqEFbCQzxtaXOtD5x/HRGwH8n0R3edDe4ojBfEarQBHdZgVYVwExdOhIZ3PgaV X-Received: by 2002:a17:90b:33c5:b0:1fe:9dc:2b1b with SMTP id lk5-20020a17090b33c500b001fe09dc2b1bmr2427863pjb.211.1662534089966; Wed, 07 Sep 2022 00:01:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662534089; cv=none; d=google.com; s=arc-20160816; b=blKm8KoYAuE/NIWyGisE4S3pQALUG/9rjDtmOO8/I9ZOzuefojt+5+CF5BqvZFTG+F kCekZY1Gajqj/z0xBLguAxWVBf/SM55jp7C0nLviW359oDj0mS3dqrNNyumHFMu/832w 0q4k+huc2uNDG+o/s19mtFV2xgBpa2jMNSkWAg8Wy6ssK8wM0GnDj+fOxly+VTYGi4+w sIImKwkLP/I0XxiIXLI2ibdS32ERt2Cg5fLQXktAE0ANXYFwAQei8vsa5Lt68AxqxQPk H1XG3L/uoni/hphGX330cNyrsP6bLV8/DtpqozOy7OW/SnhB/3ELrfyu4FaVn13EIcgI nbwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=mIzq9b1E1jNMGDUibVRJFkg8krHty9yttRJ9IPhdyfM=; b=c2ZhltVg4qbAUG7Vx2KpYjQWFLUWD+BMS8REJjmeDckUXLzToEh+uYSvrN2c6CvDYg npn8NikU/W5Vlzko1mZgpUXvCEL435Sae8arRbpCaTxPfBlHlMmrt4vZI6nvP6OnnU3P scb9pHfQcuOrBn94BpwBHVg1yISmmK0Zb1LHepfemFQ90e9GLfa6v3pV1Ii/V4WI2/E9 bq1rqgfPWs0zQzNuWi6Hx04VTrwoO3T7OCGrP0sPZ0seHJIfjUocIaWnNFY6QC+x5Cmf qjAIo7XmP3svJoiC/f5/rhr4Jc8O+AcZjJM8c9qsA5Ty2H+zJmeuik86VFIdKKZw7zr8 aMlA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mn22-20020a17090b189600b001fb2e4446c1si21622124pjb.106.2022.09.07.00.01.10; Wed, 07 Sep 2022 00:01:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229777AbiIGGwQ (ORCPT + 99 others); Wed, 7 Sep 2022 02:52:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229526AbiIGGwP (ORCPT ); Wed, 7 Sep 2022 02:52:15 -0400 Received: from fornost.hmeau.com (helcar.hmeau.com [216.24.177.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 094581CFCB for ; Tue, 6 Sep 2022 23:52:11 -0700 (PDT) Received: from gwarestrin.arnor.me.apana.org.au ([192.168.103.7]) by fornost.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1oVous-001v4u-MR; Wed, 07 Sep 2022 16:52:07 +1000 Received: by gwarestrin.arnor.me.apana.org.au (sSMTP sendmail emulation); Wed, 07 Sep 2022 14:52:06 +0800 Date: Wed, 7 Sep 2022 14:52:06 +0800 From: Herbert Xu To: Peter Harliman Liem Cc: atenart@kernel.org, linux-crypto@vger.kernel.org, linux-lgm-soc@maxlinear.com Subject: Re: [PATCH v2 1/2] crypto: inside_secure - Avoid dma map if size is zero Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Tue, Sep 06, 2022 at 10:51:49AM +0800, Peter Harliman Liem wrote: > > diff --git a/drivers/crypto/inside-secure/safexcel_cipher.c b/drivers/crypto/inside-secure/safexcel_cipher.c > index d68ef16650d4..3775497775e0 100644 > --- a/drivers/crypto/inside-secure/safexcel_cipher.c > +++ b/drivers/crypto/inside-secure/safexcel_cipher.c > @@ -737,14 +737,17 @@ static int safexcel_send_req(struct crypto_async_request *base, int ring, > max(totlen_src, totlen_dst)); > return -EINVAL; > } > - dma_map_sg(priv->dev, src, sreq->nr_src, DMA_BIDIRECTIONAL); > + if (sreq->nr_src > 0) > + dma_map_sg(priv->dev, src, sreq->nr_src, DMA_BIDIRECTIONAL); Where is the corresponding check on unmap? Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt