Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1699846

Re: [PATCH 2/2] crypto: stm32 - Support for STM32 HASH module

From Kamil Konieczny <k.konieczny@partner.samsung.com>
Newsgroups linux.kernel
Subject Re: [PATCH 2/2] crypto: stm32 - Support for STM32 HASH module
Date 2017-07-31 11:20 +0200
Message-ID <u9f1M-4rg-3@gated-at.bofh.it> (permalink)
References <u2Mvv-6cV-3@gated-at.bofh.it> <u9f1M-4rg-5@gated-at.bofh.it> <u2Mvw-6cV-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



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

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH 2/2] crypto: stm32 - Support for STM32 HASH module Kamil Konieczny <k.konieczny@partner.samsung.com> - 2017-07-31 11:20 +0200

csiph-web