From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3B264C4332F for ; Mon, 7 Nov 2022 08:47:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229680AbiKGIr2 (ORCPT ); Mon, 7 Nov 2022 03:47:28 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230510AbiKGIr1 (ORCPT ); Mon, 7 Nov 2022 03:47:27 -0500 Received: from formenos.hmeau.com (helcar.hmeau.com [216.24.177.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21C40C62; Mon, 7 Nov 2022 00:47:25 -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 1orxmH-00AyMB-Ht; Mon, 07 Nov 2022 16:47:23 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Mon, 07 Nov 2022 16:47:22 +0800 Date: Mon, 7 Nov 2022 16:47:22 +0800 From: Herbert Xu To: "yekai (A)" Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, wangzhou1@hisilicon.com Subject: Re: [PATCH v2 1/4] crypto: hisilicon/qm - modify the process of regs dfx Message-ID: References: <20221105095357.21199-1-yekai13@huawei.com> <20221105095357.21199-2-yekai13@huawei.com> <45cf9fba-fae6-8279-bfac-f70110df42dc@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <45cf9fba-fae6-8279-bfac-f70110df42dc@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Mon, Nov 07, 2022 at 02:53:28PM +0800, yekai (A) wrote: > > > On 2022/11/5 18:18, Herbert Xu wrote: > > On Sat, Nov 05, 2022 at 09:53:54AM +0000, Kai Ye wrote: > >> +static void dfx_regs_uninit(struct hisi_qm *qm, > >> + struct dfx_diff_registers *dregs, int reg_len) > >> +{ > >> + int i; > >> + > >> + /* Setting the pointer is NULL to prevent double free */ > >> + for (i = 0; i < reg_len; i++) { > >> + kfree(dregs[i].regs); > >> + dregs[i].regs = NULL; > >> + } > >> + kfree(dregs); > >> + dregs = NULL; > >> +} > > The line that I complained about is still here. > > > > Cheers, > > ok Just to be clear, it's the last line "dregs = NULL" that I was referring to. It makes no sense to zero a variable that is on the stack. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt