lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 28 Jan 2021 08:52:33 +0000
From:   Lee Jones <lee.jones@...aro.org>
To:     linux-kernel@...r.kernel.org,
        Andreas Noever <andreas.noever@...il.com>,
        Michael Jamet <michael.jamet@...el.com>,
        Mika Westerberg <mika.westerberg@...ux.intel.com>,
        Yehezkel Bernat <YehezkelShB@...il.com>,
        linux-usb@...r.kernel.org
Subject: [PATCH V2 01/12] thunderbolt: dma_port: Check
 'dma_port_flash_write_block()'s return value

... and take the error path if it fails.

Fixes the following W=1 kernel build warning(s):

 drivers/thunderbolt/dma_port.c: In function ‘dma_port_flash_write_block’:
 drivers/thunderbolt/dma_port.c:331:6: warning: variable ‘ret’ set but not used [-Wunused-but-set-variable]

Cc: Andreas Noever <andreas.noever@...il.com>
Cc: Michael Jamet <michael.jamet@...el.com>
Cc: Mika Westerberg <mika.westerberg@...ux.intel.com>
Cc: Yehezkel Bernat <YehezkelShB@...il.com>
Cc: linux-usb@...r.kernel.org
Signed-off-by: Lee Jones <lee.jones@...aro.org>
---

v2: Different approach: actually handle the error.

 drivers/thunderbolt/dma_port.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/thunderbolt/dma_port.c b/drivers/thunderbolt/dma_port.c
index 847dd07a7b172..7288aaf01ae6a 100644
--- a/drivers/thunderbolt/dma_port.c
+++ b/drivers/thunderbolt/dma_port.c
@@ -335,6 +335,8 @@ static int dma_port_flash_write_block(struct tb_dma_port *dma, u32 address,
        /* Write the block to MAIL_DATA registers */
        ret = dma_port_write(sw->tb->ctl, buf, tb_route(sw), dma->port,
                            dma->base + MAIL_DATA, dwords, DMA_PORT_TIMEOUT);
+       if (ret)
+               return ret;
 
        in = MAIL_IN_CMD_FLASH_WRITE << MAIL_IN_CMD_SHIFT;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ