Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751257AbdGMJ4m (ORCPT ); Thu, 13 Jul 2017 05:56:42 -0400 Received: from mail-ve1eur01on0055.outbound.protection.outlook.com ([104.47.1.55]:39117 "EHLO EUR01-VE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750854AbdGMJ4l (ORCPT ); Thu, 13 Jul 2017 05:56:41 -0400 From: =?iso-8859-2?Q?Horia_Geant=E3?= To: Xulin Sun , Dan Douglass , "herbert@gondor.apana.org.au" , "davem@davemloft.net" CC: "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 Thread-Topic: [PATCH v2] crypto: caam - free qman_fq after kill_fq Thread-Index: AQHS+7lhDnKJaizhbEOdMeBTUCbSyA== Date: Thu, 13 Jul 2017 09:56:34 +0000 Message-ID: References: <20170711062107.182889-1-xulin.sun@windriver.com> <20170713092101.145505-1-xulin.sun@windriver.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: windriver.com; dkim=none (message not signed) header.d=none;windriver.com; dmarc=none action=none header.from=nxp.com; x-originating-ip: [192.88.146.1] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;VI1PR0401MB2622;7:OsyWTOvbDeTfAGuWoX1/p176ElhMJjOTbk3sQ+7o2NuzaFQig8tNqyJ9G469VILOFLQG9nnq48zDAT5Geh4isVImdWTkrLkXfZvsEpHqnjhF5nWWf2FTY7CKwqZpvQxMts3bnblOgmjNOvenG/s5mJxsmV8TMjsY9LwrUrInlNMb9WT3EjhdImKkBLig+1MT6tZtN+7FJg6iCWQ5aug++/4jt6M+qz+kZxIqEDSD1uMbQlMFAY1Tw+bZaRoOB16ZchEht7f1lsNOWqH/wDt30IMzKdvBk2OmF6Y+omXdEpDgaf0iytaJ+TOYzZEFEZtGQ9Zr+6nA8WNG6IY6s3iZXpH+C5k0MQxW/qufNi0rk3zSSXtXKCSWkJ/1gwQaK/ewR3/MaDPEGE/a+t9V04zceaNEyoBJAqA8BLAA4+Ka+mYoTLWP0onlciVtFTDYMNwVOCnLrbTCBN1xbVYHj15PGHyj2QKA/getpHYdezingbuMUD1f7eTlYUU7yf7sULHOQTPfZcQZmc7J6yZz8YhSbVMvj9yeB7dJqeTS3R58KHosuZcCP7InJL6YgIkOQS8V+fX5UJlVy44IwSb6Nu4B9FDYaCdl76bt6/5UKyB0omUOVbH5/nm3LzY/Jnpcpye/8vDW0vzDc9ypEwi5klsU5/yhSKBGy0sCiVEnvfd3oU6OqgKrmgYiyoF5NBwL/TrcsQXyKYL5B9ZJHlNC7sz3CNv1FsuQUwR9OE69b1V73d1S+LhQNk4m6oyCibBj0mlCsjKcBq394N358Cgoh7DqXNuLhmvYMtmUW4HmmYWVR9E= x-forefront-antispam-report: SFV:SKI;SCL:-1SFV:NSPM;SFS:(10009020)(6009001)(39860400002)(39840400002)(39410400002)(39400400002)(39850400002)(39450400003)(377454003)(24454002)(2201001)(6436002)(229853002)(9686003)(3846002)(478600001)(3280700002)(33656002)(54356999)(53936002)(66066001)(4326008)(74316002)(25786009)(102836003)(2900100001)(76176999)(5660300001)(3660700001)(6116002)(50986999)(305945005)(189998001)(53546010)(55016002)(2906002)(7696004)(5250100002)(8676002)(99286003)(14454004)(38730400002)(39060400002)(54906002)(6246003)(7736002)(2501003)(86362001)(6506006)(68736007)(81166006)(8936002);DIR:OUT;SFP:1101;SCL:1;SRVR:VI1PR0401MB2622;H:VI1PR0401MB2591.eurprd04.prod.outlook.com;FPR:;SPF:None;MLV:ovrnspm;PTR:InfoNoRecords;LANG:en; x-ms-office365-filtering-correlation-id: 5fd99484-3d72-4429-3b35-08d4c9d57266 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254075)(300000503095)(300135400095)(48565401081)(2017052603031)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:VI1PR0401MB2622; x-ms-traffictypediagnostic: VI1PR0401MB2622: x-exchange-antispam-report-test: UriScan:(236129657087228)(185117386973197); x-microsoft-antispam-prvs: x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(5005006)(8121501046)(2017060910075)(10201501046)(93006095)(93001095)(3002001)(100000703101)(100105400095)(6055026)(6041248)(20161123558100)(20161123555025)(20161123564025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:VI1PR0401MB2622;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:VI1PR0401MB2622; x-forefront-prvs: 0367A50BB1 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-2" MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Jul 2017 09:56:34.8883 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0401MB2622 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by nfs id v6D9unkN010165 Content-Length: 1430 Lines: 33 On 7/13/2017 12:21 PM, 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 Acked-by: Horia Geant? Thanks, Horia