Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3088211rwb; Mon, 15 Aug 2022 17:50:30 -0700 (PDT) X-Google-Smtp-Source: AA6agR42GewSinFqDV6uuPHWWjItXfB0ndtp08zkP3gZYVkvr7Fc0yFH34qFv3vUxpcbmr07VBge X-Received: by 2002:a17:907:1690:b0:731:56b6:fded with SMTP id hc16-20020a170907169000b0073156b6fdedmr12197251ejc.119.1660611030093; Mon, 15 Aug 2022 17:50:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660611030; cv=none; d=google.com; s=arc-20160816; b=H0KkRdEmyUvx9QdCddhge0HzTX11r5bH3nmcG7EJv7OJgp+t82NyWmqPIPVfTk4SF7 Tj26HEJxX5AiL9wRvNz9PD4l2tsodilZPN9ENxyh+AvfLtTMl3Rm4XSkxl1HHHB9NNpM gphHlnmJcZuijNC8tYzpNSk/j7i7EAD3isfENf6fra+IGv1BazcwMAT8E3mVw1eYwJoa eqOZ9oRtLz5vP0n/Uy7EuAoj4puI18lSRO+P8EvAhJ5KtbwQ0uyPHZqPfhBPXSEOj3z+ fuknd5NMT6UUgL1RczxuiBBMmary5ONwB2XXDh16KxiKe6DW2jSFEg+mXBVyz+EEq4ZR gduA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0jsmmC3//MHu2S/NU6w7DUQ2C7/pD5aBXIlj6rJxCIc=; b=hFeTuSjHCjUBbMao9WwjxYWK28i55kLR8y50p7/G8D/8kQEJNm9i2Fl/JL2aipTpez y6eGNWumtDPrlgkakozf5WCf9msH+9m2zHTec8sKs8IH9LSvinIhc38lCfWdoyA8Z8kT eKSvx4mjeACLylSvWvyczKA4LJCQYuCoVGNSAHOG4ozztZeGWqDdxRXBDCDO9uTOeUI2 yAkdVjmP1Zma+8vk1NFB2QOoLXkg1X+dVDPeCzND/pxvEAtZWd3aIub/76QeSJk+9nLu 6Pu1KViiCeFvuUwGk8LiTPMbxvpYQr55oWxBr1zwZGePSI07gOiVA3yFHje2GSJswDzF UZJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xHut8VJs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 24-20020a170906329800b007330202ea43si7775348ejw.394.2022.08.15.17.50.04; Mon, 15 Aug 2022 17:50:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xHut8VJs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346573AbiHOXat (ORCPT + 99 others); Mon, 15 Aug 2022 19:30:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244913AbiHOXYj (ORCPT ); Mon, 15 Aug 2022 19:24:39 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB164804BD; Mon, 15 Aug 2022 13:05:51 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B42A56069F; Mon, 15 Aug 2022 20:05:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BE282C433C1; Mon, 15 Aug 2022 20:05:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660593950; bh=Qq5+Pd5ZEXH8JI+FXJrqFDMhbWQ9+lFV5YV4MmmrBQo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xHut8VJsBFR2u6ji1Gf2YD88erOT4Cm5EFPpASnjx3S955D8aUdxAER8QRe7QopZE t6BqFa2YaLyv/ZadiuxolggDbNEwhB23jeE7KfBy5RU21zRKdLIpUTBvLijddbQuWb daKgJ9dFoVac2tZ7X+CEvHvo5EQOqk9Jv55UZUrE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Corentin Labbe , Herbert Xu , Sasha Levin Subject: [PATCH 5.19 0353/1157] crypto: sun8i-ss - Fix error codes for dma_mapping_error() Date: Mon, 15 Aug 2022 19:55:09 +0200 Message-Id: <20220815180453.834444151@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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-kernel@vger.kernel.org From: Dan Carpenter [ Upstream commit 6cb3f9b25c55928b95a02b9ed8e87ed653b3cce8 ] If there is a dma_mapping_error() then return negative error codes. Currently this code returns success. Fixes: 801b7d572c0a ("crypto: sun8i-ss - add hmac(sha1)") Signed-off-by: Dan Carpenter Acked-by: Corentin Labbe Tested-by: Corentin Labbe Signed-off-by: Herbert Xu Signed-off-by: Sasha Levin --- drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c index ac417a6b39e5..845019bd9591 100644 --- a/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c +++ b/drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c @@ -586,7 +586,8 @@ int sun8i_ss_hash_run(struct crypto_engine *engine, void *breq) rctx->t_dst[k + 1].len = rctx->t_dst[k].len; } addr_xpad = dma_map_single(ss->dev, tfmctx->ipad, bs, DMA_TO_DEVICE); - if (dma_mapping_error(ss->dev, addr_xpad)) { + err = dma_mapping_error(ss->dev, addr_xpad); + if (err) { dev_err(ss->dev, "Fail to create DMA mapping of ipad\n"); goto err_dma_xpad; } @@ -612,7 +613,8 @@ int sun8i_ss_hash_run(struct crypto_engine *engine, void *breq) goto err_dma_result; } addr_xpad = dma_map_single(ss->dev, tfmctx->opad, bs, DMA_TO_DEVICE); - if (dma_mapping_error(ss->dev, addr_xpad)) { + err = dma_mapping_error(ss->dev, addr_xpad); + if (err) { dev_err(ss->dev, "Fail to create DMA mapping of opad\n"); goto err_dma_xpad; } -- 2.35.1