Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751388AbdILJgu (ORCPT ); Tue, 12 Sep 2017 05:36:50 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:63893 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751214AbdILJgs (ORCPT ); Tue, 12 Sep 2017 05:36:48 -0400 From: Arnd Bergmann To: Lionel Debieve Cc: Arnd Bergmann , Herbert Xu , "David S. Miller" , Maxime Coquelin , Alexandre Torgue , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] crypto: stm32 - Fix uninitialized data usage Date: Tue, 12 Sep 2017 11:35:38 +0200 Message-Id: <20170912093553.2580986-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:pq236YfxbVNwqj355JlDKkTRo6fzQdnPRprypRxSAhAXZDs/HSc PzTueg773DKir5HcHp29L0K5buZ9E7KIheuWixMVb5TalKHzrHzBigWpkd+Pe2XLRFufmPK E3UO/lsUO3Add5d5O1gOBck0nfBKtMJGZda3g73DtCTs37c0phD+Stq4GG+RixKXf/Ibadd fsyqmFLix8XMOzxqoI3Gw== X-UI-Out-Filterresults: notjunk:1;V01:K0:RppDc2c8SGg=:j+4EbY9dofdT2lEgGa8Tj4 lGmgntTfTEmCLv8q1LMnBX83Lcd6pIWgyoB18uv6MQ7A45ej+ywB8tEr2J2gyZUYXBMEbmlYI 1aa9WvOTLoGqDIZZSXfqMYL0z2cG0Yr5FLjyzuEzwgKg91ZbhaCQxup6OwdOGlw4gZHfbV+lP WdLJ1uOFlwR1ePDanNC/IUk9AsFSdIwsYaG+4a1uZ+c7oMcKKld7GFW8cmRzHNDUQV6yIQNYg ZuZ/81KWxbsV3f/f10BDZY8AiPvpknjJxuigmgNa+qrDVNrrrQfKo8cQZA4DajNwTPEhrL5xC EiB78bTx5Bd+myGlflqcS/QiZ/sVDLMeROu733eJeJoE/GpEfSRNnYj/7ByLvWrb/htPu/p4h IHeZr83mNjtnSsS3x9YArAyv3JCgLaErKiWyK4X7DGwMQBMu6ApaGVnArVpfqlIpGvB3IBkyv DybaZokscVq4YJGCPtWtBBm4HretrVNEGsSewbITCkTzuuRzxSOah3sKPqP+BcKvNtl4pcZ6C 1j6GMy9U9EoyrR/UwB0aI6XGujgRxvRsF08yWdzJoVpENcDbndPRY2YBHpja9sJyXwAGwRxaM VtST/JFIDBkGh7z9PM/BZES3reIhpaUqHk1tX+t0o0GolDTOsoOxhLuy4Ny6AClG7LXVXNT8y Ip3sCYJmeai/zFkbMphigwi3qO9QrBMeSoQ6i2/ulyBMXv32YAGY9rH0jn+LhFDO11oske4Rt bLmxr7ulccDr6Kh8wvkj0GuCGvaBxWaC2NCcJA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1371 Lines: 39 The error handling in stm32_hash_irq_thread passes uninitialized data into stm32_hash_finish_req, as gcc points out: drivers/crypto/stm32/stm32-hash.c: In function 'stm32_hash_irq_thread': drivers/crypto/stm32/stm32-hash.c:1088:2: error: 'err' may be used uninitialized in this function [-Werror=maybe-uninitialized] I could not tell what data should be passed there instead, so this changes the code to always pass zero, making it well-defined, though possibly still wrong. Please check. Signed-off-by: Arnd Bergmann --- drivers/crypto/stm32/stm32-hash.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/crypto/stm32/stm32-hash.c b/drivers/crypto/stm32/stm32-hash.c index b585ce54a802..3c23a23e9ee5 100644 --- a/drivers/crypto/stm32/stm32-hash.c +++ b/drivers/crypto/stm32/stm32-hash.c @@ -1067,7 +1067,6 @@ static int stm32_hash_cra_sha256_init(struct crypto_tfm *tfm) static irqreturn_t stm32_hash_irq_thread(int irq, void *dev_id) { struct stm32_hash_dev *hdev = dev_id; - int err; if (HASH_FLAGS_CPU & hdev->flags) { if (HASH_FLAGS_OUTPUT_READY & hdev->flags) { @@ -1085,7 +1084,7 @@ static irqreturn_t stm32_hash_irq_thread(int irq, void *dev_id) finish: /*Finish current request */ - stm32_hash_finish_req(hdev->req, err); + stm32_hash_finish_req(hdev->req, 0); return IRQ_HANDLED; } -- 2.9.0