Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752010AbdG1NuH (ORCPT ); Fri, 28 Jul 2017 09:50:07 -0400 Received: from orcrist.hmeau.com ([104.223.48.154]:39882 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751690AbdG1NuF (ORCPT ); Fri, 28 Jul 2017 09:50:05 -0400 Date: Fri, 28 Jul 2017 21:49:49 +0800 From: Herbert Xu To: Xulin Sun Cc: horia.geanta@nxp.com, dan.douglass@nxp.com, davem@davemloft.net, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, xulinsun@gmail.com Subject: Re: [PATCH v2] crypto: caam - free qman_fq after kill_fq Message-ID: <20170728134949.GB21401@gondor.apana.org.au> References: <20170711062107.182889-1-xulin.sun@windriver.com> <20170713092101.145505-1-xulin.sun@windriver.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170713092101.145505-1-xulin.sun@windriver.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1569 Lines: 35 On Thu, Jul 13, 2017 at 05:21:01AM -0400, Xulin Sun wrote: > kill_fq removes a complete frame queue, it needs to free the qman_fq > in the last. Else kmemleak will report the below warning: > > unreferenced object 0xffff800073085c80 (size 128): > comm "cryptomgr_test", pid 199, jiffies 4294937850 (age 67.840s) > hex dump (first 32 bytes): > 00 00 00 00 00 00 00 00 a0 80 7e 00 00 80 ff ff > 00 00 00 00 00 00 00 00 04 00 04 00 5c 01 00 00 > backtrace: > [] create_object+0xf8/0x258 > [] kmemleak_alloc+0x58/0xa0 > [] kmem_cache_alloc_trace+0x2c8/0x358 > [] create_caam_req_fq+0x40/0x170 > [] caam_drv_ctx_update+0x54/0x248 > [] aead_setkey+0x154/0x300 > [] setkey+0x50/0xf0 > [] __test_aead+0x5ec/0x1028 > [] test_aead+0x44/0xc8 > [] alg_test_aead+0x58/0xd0 > [] alg_test+0x14c/0x308 > [] cryptomgr_test+0x50/0x58 > [] kthread+0xdc/0xf0 > [] ret_from_fork+0x10/0x50 > > And check where the function kill_fq() is called to remove > the additional kfree to qman_fq and avoid re-calling the released qman_fq. > > Signed-off-by: Xulin Sun Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt