From patchwork Mon Jun 15 23:52:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victoria Milhoan X-Patchwork-Id: 6612471 X-Patchwork-Delegate: herbert@gondor.apana.org.au Return-Path: X-Original-To: patchwork-linux-crypto@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 87F52C0020 for ; Mon, 15 Jun 2015 23:53:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9AE3E203C0 for ; Mon, 15 Jun 2015 23:53:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 78A17203B5 for ; Mon, 15 Jun 2015 23:53:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751132AbbFOXxO (ORCPT ); Mon, 15 Jun 2015 19:53:14 -0400 Received: from mail-bn1on0111.outbound.protection.outlook.com ([157.56.110.111]:35168 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750897AbbFOXxM (ORCPT ); Mon, 15 Jun 2015 19:53:12 -0400 Received: from DM2PR03CA0038.namprd03.prod.outlook.com (10.141.96.37) by DM2PR03MB399.namprd03.prod.outlook.com (10.141.84.148) with Microsoft SMTP Server (TLS) id 15.1.195.6; Mon, 15 Jun 2015 23:53:11 +0000 Received: from BN1BFFO11FD055.protection.gbl (2a01:111:f400:7c10::1:188) by DM2PR03CA0038.outlook.office365.com (2a01:111:e400:2428::37) with Microsoft SMTP Server (TLS) id 15.1.190.14 via Frontend Transport; Mon, 15 Jun 2015 23:53:10 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD055.mail.protection.outlook.com (10.58.145.10) with Microsoft SMTP Server (TLS) id 15.1.190.9 via Frontend Transport; Mon, 15 Jun 2015 23:53:10 +0000 Received: from stc-hedley.am.freescale.net (stc-hedley.am.freescale.net [10.67.70.12]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id t5FNr7p2003741; Mon, 15 Jun 2015 16:53:09 -0700 From: Victoria Milhoan To: CC: , , Subject: [PATCH RFC 07/11] crypto: caam - Unmap data prior to displaying data in print statements Date: Mon, 15 Jun 2015 16:52:55 -0700 Message-ID: <1434412379-11623-8-git-send-email-vicki.milhoan@freescale.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1434412379-11623-1-git-send-email-vicki.milhoan@freescale.com> References: <1434412379-11623-1-git-send-email-vicki.milhoan@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD055; 1:m6tYA4pJh9JnPnPL8Spg6OjX34EoDBNLt4PZ8awzAs3MJTsOEQEq4xgXv6yPIdkGmfROGUXKJ85h8R/9zet7RfyIdEA1T3DUS+jmPOKVF6gpGHDS93OYgIsGXGh0VVvDRP4IZLbBH4n/5nq8d4f+BbimaxEOrknAdzWE1qIZ7e9+vQVi4exg8Tvwp/pAqNUD7xW90XaaiOEkKL35wzRqMpvKnyir8Aiqax1XH8MHuACYyXmTWMeqQNOBVgngdWWMQYvMzQ5dP25iiU5Gy3Eyb/WfZgo9kGGwSptlkvb20xlM7jj2bv2PUnjIQQ+6idLCktG3xAidQFZc8rpG72156WqUHCWIc8WlDDm+Z0/h2JE= X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(339900001)(199003)(189002)(76176999)(77096005)(86362001)(46102003)(105606002)(50226001)(19580395003)(36756003)(33646002)(19580405001)(2950100001)(48376002)(50986999)(50466002)(85426001)(47776003)(6806004)(77156002)(5001960100002)(110136002)(107886002)(189998001)(87936001)(2351001)(62966003)(92566002)(106466001)(104016003)(229853001)(4001430100001)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR03MB399; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; MLV:sfv; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; DM2PR03MB399; 2:uxy9CHeJc+ETw6kcWQkbdB11XwH3OVgBHux5Ksw+TS93DOy1NIjwEw/isRTm+5Cg; 3:y2nt4AtmjV0ZsnFafnTwAFzTDA4carCwz3psmXSudHsgyorBsA7Dnk3kMJqT3K+XnrE2eVDbXZQuJvv84Glen8pafjMsy9Bn3KnR4DaUTSRyjQMkMXxWL7ViTGSW2+tMNoUJN5COUsVSYEn2pP2T3cJtAGzJZvMMHoDKolK2WQ7ctSDUKzy77WYXmxMJ4EEhtJOcJBbvoa1RsDtE3YShaTRhyOZu1frOTShcXeXprM8=; 20:C/o1kMlMUXBQly9l8T7VjaVRfky60oEFzSvH9tr+3BhF1+meTNsfDTAdfLUk8ZbccrxI9YkLwFXoI7HgNLsHdVZA2bBQhCFEvPQi9dCNAOz+VYIVF3X6+hJdUCtap2CgGNHencYSuuUAqzJfFOpYO8rftWSOtT0B67G0Th2Tt8FRMzrmpSAQ4ApkQstK8fLoHj1FoODqdXCCly68XXP3drme6oYCENJlLYUyRAIbmx/5kBeRea1ucKFGvAOW/zOy8HJEP66Eu7FiJVGQC5OghtV8CKpQp9xoqImpA9j3ot7E58f6DFeSZb36M0eTTu7yeoDy6pfZxf2j0zM17E65yvl/LntOOCG4eNVygUo8Jh4=; 4:Zd6RmyYPJOKS9LitCRXh9fVWaSRPpqM160CqpOpucmJ3WvPL5KPnuXGLp8Yt2Clchz9K8Og9bjkGNTXQtHLQIFZHIPcGD9gEMN34thC5buKOctoQr5+rvBTGVUp+ClX8rnnk35F1UicTJ3wF2yVla6wlWboOW3vH/TvsscBfFBVAN3OGgS1c1uaEI1W2slRSBKj4Tq/FxRULtGvTPIsl43CwY/ie6FWhzOLxJF8fVIEsOR2R9LG4em8wa0HeIyRxCfJkNWWVc q8ejxQ7/PAADrc9YPF6GyeT9IfOs7cvbaU= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR03MB399; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:DM2PR03MB399; BCL:0; PCL:0; RULEID:; SRVR:DM2PR03MB399; X-Forefront-PRVS: 0608DEDB67 X-Microsoft-Exchange-Diagnostics: 1; DM2PR03MB399; 23:FfUrFYLtcXZybrWewfjkQO7sz9FrVFhc2O2NuTCL3poiRBHFZdMOTh3rJ6Bb7/HFh9f+SWayIi37G2aAqqnV2WmWk0cYk2YvltL6PMqP34H/8GKUMmxzDkWlKyNhd4yCb+gwzJ4ix9trYEGQPmRHveNnBk6y3J7x9mpNvL97MCbT0SyczzYakYJLoqS8P3Pa5giOebvSZ3dcecY6FfvQbwQ8nM+0Q7+0jRNFqhwNVhBUT5vV7YgxVRs+tKQzK6lONQ+xDmCUVIbuCsMP8wb1t1NxNn4yi61HMupTyz4XUbAo2r++ggHTiXWc/HDVKVeBoHOF4lgNxHjK++hDzXLoaw+tDw8qb779Zqef2diEkoaRS4sxXg0Q55WasaM1LmhOdh6ugs206sK28zQK+0UD7tRxsnbZ5ODoOLzWZmbqsoN+QMCf64NnQWclJZX2meeyF1lOZhxu+2DNJUlBQQ3TdO7WZmAbcwEHDKxSTD3LlSZ6dlFuWNhgXJAUwQfQ7JQDIVgHWsccKr9QtIqbwIXxNOtvd8pG/+AkxFPWQ/R+fcDJOJxRSqoP9eDtb1x/l4eQJPx9SywB9ZGU5THOlwbxN9rZT1XsnEYkrVrF7iT3Q0qveljAryi3mFgxj2KS59icprf8iALnyj8bDkz+Sy2fIEn/+iAV+X4N6drLyv2RsLp3/PMJj7bt7t/KfpeaAuAb6/Brnbh4fy5I/HeMOdpFSGCD/Nzd+08s42tmH4UsedMpu0Ow0eBfXjYqLwK9AWuElt/8bLhdP0VKVG7MkeNErM7jnQ/paUoSlEnWPQgcjRPfjSbAT05zXzyG3cVuqaIkXzwn1kz8JdWXQmdV9Uig2VjVnrLwkNM298Kg4xLjiyH2FaLW2qMNg57obloPaEhyxGIYDdL1ywETBrgISfT7E8mvszUuKPIrfdTRamaLTy c= X-Microsoft-Exchange-Diagnostics: 1; DM2PR03MB399; 5:4pF9wRYjdCHSDoh4ty4rFvkMxGZi3dATWGrWIFG6Gjj/oXSa0Xe5O+ZPY0g4D8U+Fx+5omOwEFmEq6Kyk2I8lmaAqYftXnAAcinZaNBh9Uz1IkqFXouWt+leKQnfjnXv7ivXhdqPhSpS3RZX1zfO9w==; 24:4MeJlJv4g/fFtTR1IWbjoUHrMeZOi7S+8CdWQXKRBBZNvmRi0LdRmUYPH8DdvKX5ANJt6fJPidsepr//R7Xc/njGZCrM/JGuZej4uoTYvZU=; 20:cpwhe2LmmfUCON0UZ1us53NTbq8/nSSKMApcLfbg/p+TKDAwMqPv/EDjv45HkOfd2e8rhKoO+9zHo0Zi+ApTng== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Jun 2015 23:53:10.4942 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR03MB399 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Move the dma unmap calls for data to occur before printing the data in debug print statements. Signed-off-by: Victoria Milhoan --- drivers/crypto/caam/caamalg.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c index 29071a1..291a1a7 100644 --- a/drivers/crypto/caam/caamalg.c +++ b/drivers/crypto/caam/caamalg.c @@ -2234,6 +2234,11 @@ static void aead_decrypt_done(struct device *jrdev, u32 *desc, u32 err, edesc = (struct aead_edesc *)((char *)desc - offsetof(struct aead_edesc, hw_desc)); + if (err) + caam_jr_strstatus(jrdev, err); + + aead_unmap(jrdev, edesc, req); + #ifdef DEBUG print_hex_dump(KERN_ERR, "dstiv @"__stringify(__LINE__)": ", DUMP_PREFIX_ADDRESS, 16, 4, req->iv, @@ -2243,11 +2248,6 @@ static void aead_decrypt_done(struct device *jrdev, u32 *desc, u32 err, req->cryptlen - ctx->authsize, 1); #endif - if (err) - caam_jr_strstatus(jrdev, err); - - aead_unmap(jrdev, edesc, req); - /* * verify hw auth check passed else return -EBADMSG */ @@ -2292,6 +2292,8 @@ static void ablkcipher_encrypt_done(struct device *jrdev, u32 *desc, u32 err, if (err) caam_jr_strstatus(jrdev, err); + ablkcipher_unmap(jrdev, edesc, req); + #ifdef DEBUG print_hex_dump(KERN_ERR, "dstiv @"__stringify(__LINE__)": ", DUMP_PREFIX_ADDRESS, 16, 4, req->info, @@ -2301,7 +2303,6 @@ static void ablkcipher_encrypt_done(struct device *jrdev, u32 *desc, u32 err, edesc->dst_nents > 1 ? 100 : req->nbytes, 1); #endif - ablkcipher_unmap(jrdev, edesc, req); kfree(edesc); ablkcipher_request_complete(req, err); @@ -2324,6 +2325,8 @@ static void ablkcipher_decrypt_done(struct device *jrdev, u32 *desc, u32 err, if (err) caam_jr_strstatus(jrdev, err); + ablkcipher_unmap(jrdev, edesc, req); + #ifdef DEBUG print_hex_dump(KERN_ERR, "dstiv @"__stringify(__LINE__)": ", DUMP_PREFIX_ADDRESS, 16, 4, req->info, @@ -2333,7 +2336,6 @@ static void ablkcipher_decrypt_done(struct device *jrdev, u32 *desc, u32 err, edesc->dst_nents > 1 ? 100 : req->nbytes, 1); #endif - ablkcipher_unmap(jrdev, edesc, req); kfree(edesc); ablkcipher_request_complete(req, err);