Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751937AbdGaJQd (ORCPT ); Mon, 31 Jul 2017 05:16:33 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:24512 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751839AbdGaJQa (ORCPT ); Mon, 31 Jul 2017 05:16:30 -0400 X-AuditID: cbfec7f4-f79806d000001279-e8-597ef56bc83e Subject: Re: [PATCH 2/2] crypto: stm32 - Support for STM32 HASH module To: Lionel Debieve , Herbert Xu , "David S . Miller" , Rob Herring , Mark Rutland , Maxime Coquelin , Alexandre Torgue , linux-crypto@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Benjamin Gaignard , Fabien Dessenne , Ludovic Barre From: Kamil Konieczny Message-id: <8a6bd548-a23a-7aa3-4b3c-b02e1f167c05@partner.samsung.com> Date: Mon, 31 Jul 2017 11:16:25 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-version: 1.0 In-reply-to: <1499952747-16423-3-git-send-email-lionel.debieve@st.com> Content-type: text/plain; charset=utf-8 Content-language: en-US Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrBKsWRmVeSWpSXmKPExsWy7djPc7rZX+siDdbdFrHY+OQ0o0Xf/Ces FnPOt7BYzD9yjtXi2LrtjBbdr2QsNj2+xmpx/95PJovLu+awWWw78JjF4sgBR4ul1y8yWcz7 u5bVonXvEXYHPo8189YwemxZeZPJY+esu+we2w6oemxa1cnmsXlJvcfTH3uZPT5vkgvgiOKy SUnNySxLLdK3S+DK+HSpmblgO2fF7tMt7A2Me9m7GDk5JARMJM7/6WODsMUkLtxbD2RzcQgJ LGWUaFpxmRkkISTwmVFi2xEnmIavJ26xQBQtY5S42HKGGcJ5xiix6NgRsA5hATeJ//enMoE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EJEYBWzxIZXf5lBHGaBJkaJ38emM4JUCQlcZZT4d0gfxGYT MJd4tP0ME4jNC9R97+xMIJuDg0VAVeLm+VSQsKhAhETf28vsECWCEj8m3wM7iROofOuXG2wg 5cwC6hJTpuSChJkFxCWaW2+yQNjyEpvXvGWewCg4C0n3LISOWUg6ZiHpWMDIsopRJLW0ODc9 t9hIrzgxt7g0L10vOT93EyMwzrcd+7llB2PXu+BDjAIcjEo8vB0hdZFCrIllxZW5hxglOJiV RHjf7wYK8aYkVlalFuXHF5XmpBYfYjQF+mwis5Rocj4wBeWVxBuaGJpbGhoZW1iYGxkpifNO /XAlXEggPbEkNTs1tSC1CKaPiYNTqoFxT9c67rPL//2+v+2Z8+xDntMeGAe1bwpeNLtAuHzV 7RC9wt2P5Ksk/u6an/j83XlJ5ddn80sFFr04Pe8r/8z1C262LGla7uZRvVfsUVS7SRNHSvfP 7O9rV6ZwZFaZ9pSfffB7UcCr+zc1/vgYd4Ru/mj96Xw7X/Wnv6nnO2ov9fz5yciRsOuguxJL cUaioRZzUXEiAPHcR0IJAwAA X-MTR: 20000000000000000@CPGS X-CMS-MailID: 20170731091626eucas1p2abbde57608d9b5948f9db1858401342c X-Msg-Generator: CA X-Sender-IP: 182.198.249.180 X-Local-Sender: =?UTF-8?B?S2FtaWwgS29uaWVjem55G1NSUE9MLUtlcm5lbCAoVFApGw==?= =?UTF-8?B?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?UTF-8?B?S2FtaWwgS29uaWVjem55G1NSUE9MLUtlcm5lbCAoVFApG1Nh?= =?UTF-8?B?bXN1bmcgRWxlY3Ryb25pY3MbU2VuaW9yIFNvZnR3YXJlIEVuZ2luZWVy?= X-Sender-Code: =?UTF-8?B?QzEwG0VIURtDMTBDRDAyQ0QwMjczOTI=?= CMS-TYPE: 201P X-HopCount: 7 X-CMS-RootMailID: 20170713133412epcas5p29f30bb8be65b6f7673dbd70182674fc9 X-RootMTR: 20170713133412epcas5p29f30bb8be65b6f7673dbd70182674fc9 References: <1499952747-16423-1-git-send-email-lionel.debieve@st.com> <1499952747-16423-3-git-send-email-lionel.debieve@st.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1161 Lines: 48 On 13.07.2017 15:32, Lionel Debieve wrote: > This module register a HASH module that support multiples > algorithms: MD5, SHA1, SHA224, SHA256. [...] > +static irqreturn_t stm32_hash_irq_thread(int irq, void *dev_id) > +{ > + struct stm32_hash_dev *hdev = dev_id; > + int err; The 'err' var is used without initialize. > + > + if (HASH_FLAGS_CPU & hdev->flags) { > + if (HASH_FLAGS_OUTPUT_READY & hdev->flags) { > + hdev->flags &= ~HASH_FLAGS_OUTPUT_READY; > + goto finish; > + } > + } else if (HASH_FLAGS_DMA_READY & hdev->flags) { > + if (HASH_FLAGS_DMA_ACTIVE & hdev->flags) { > + hdev->flags &= ~HASH_FLAGS_DMA_ACTIVE; > + goto finish; > + } > + } > + > + return IRQ_HANDLED; > + > +finish: > + /*Finish current request */ > + stm32_hash_finish_req(hdev->req, err); > + > + return IRQ_HANDLED; > +} > + and here is beginnig for finish_req: +static void stm32_hash_finish_req(struct ahash_request *req, int err) +{ + struct stm32_hash_request_ctx *rctx = ahash_request_ctx(req); + struct stm32_hash_dev *hdev = rctx->hdev; + + if (!err && (HASH_FLAGS_FINAL & hdev->flags)) { -- Best regards, Kamil Konieczny Samsung R&D Institute Poland