Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2521112rwb; Fri, 9 Dec 2022 03:15:19 -0800 (PST) X-Google-Smtp-Source: AA0mqf4yLgu2Bh3gd2qEDWXYL4kdG0ZTVsPaO8iqybLsuQ4PQsGgqUKfGR6xUI924FXEl42fV1oB X-Received: by 2002:a05:6402:4021:b0:46c:fabe:835d with SMTP id d33-20020a056402402100b0046cfabe835dmr8554205eda.12.1670584518796; Fri, 09 Dec 2022 03:15:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670584518; cv=none; d=google.com; s=arc-20160816; b=xnalvLwYu6GRVCfUHz+xl4jtJyvq/AKRg/KBZZAeyPXpBmOUtFb8bT11gO6F5u7izv vbZtlOUjARfkA9rvLhYtoduvGf9udRur5DVZI2zt1QRdrcmW37u8y/GUu4vQROY6e493 EoRsnTTxK/E10GvW3bzRPZ441GqNjYqj/mMExRuzjlcfj18u1IsbMYBqfCEJe6HKGO8z DCE8pHLkWYt4tIUfImG84xx435299m8mbyya7ul5QUvHisDcy6K4EwMoyopThVAKYUXr xybsG1T4kYphtJ3eEES7mJGXH0W08S8JpBPD0ziyqLMH4hBKae3aVZ75PfKwBWyCsX9E a0BA== 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=G2BRES9SHCmAdiNxhkN1d8RKNZnmctBmIVjxgAf6Ask=; b=HVUhRLtDP8adEx2gthjp1BWyrBgPJrekAxolJdeMWA6goSzhexgtd3/n4XoStIvjZA ubVIU9YV8hZnrkBGRQRq/FYAMSJwA9cq1LPVvHomb/6AFuRiTdxwQSCHm6DJZXLi69Of w0jrao1bTNweerKQ6ZPmylivCyJbalzMcqymRNgIbmP+BgwEaQaLtQ0FoazGAAN7XK2d CLU9XAzB7d4xIhd5fFFyLEZhsGBFZ985jrAhFBll7o7wnxKnq6IHHt4fpMAcxMMFkZ5k ZTp5QDJDn1BZQTHEOtM5wFD2nKcNbry2G2frlyZ6tmIoAkxS7MZ2vFZTxul9wH1YnVV7 goTA== 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 t9-20020a50ab49000000b0046b7d1b9d79si1121212edc.328.2022.12.09.03.14.46; Fri, 09 Dec 2022 03:15:18 -0800 (PST) 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 S229470AbiLILIE (ORCPT + 99 others); Fri, 9 Dec 2022 06:08:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229573AbiLILID (ORCPT ); Fri, 9 Dec 2022 06:08:03 -0500 Received: from formenos.hmeau.com (helcar.hmeau.com [216.24.177.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BBA111C3E for ; Fri, 9 Dec 2022 03:08:03 -0800 (PST) Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1p3bEK-005gk4-9e; Fri, 09 Dec 2022 19:07:49 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Fri, 09 Dec 2022 19:07:48 +0800 Date: Fri, 9 Dec 2022 19:07:48 +0800 From: Herbert Xu To: Gaosheng Cui Cc: davem@davemloft.net, james.hartley@imgtec.com, abrestic@chromium.org, will.thomas@imgtec.com, linux-crypto@vger.kernel.org Subject: Re: [PATCH] crypto: img-hash - Fix variable dereferenced before check 'hdev->req' Message-ID: References: <20221201062526.4089-1-cuigaosheng1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221201062526.4089-1-cuigaosheng1@huawei.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS 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 Thu, Dec 01, 2022 at 02:25:26PM +0800, Gaosheng Cui wrote: > Smatch report warning as follows: > > drivers/crypto/img-hash.c:366 img_hash_dma_task() warn: variable > dereferenced before check 'hdev->req' > > Variable dereferenced should be done after check 'hdev->req', > fix it. > > Fixes: d358f1abbf71 ("crypto: img-hash - Add Imagination Technologies hw hash accelerator") > Fixes: 10badea259fa ("crypto: img-hash - Fix null pointer exception") > Signed-off-by: Gaosheng Cui > --- > drivers/crypto/img-hash.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt