From: Lee Jones Date: Thu, 28 Jan 2021 08:52:33 +0000 (+0000) Subject: thunderbolt: dma_port: Check 'dma_port_flash_write_block()'s return value X-Git-Tag: v5.15~1778^2~12^2~22 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f679a41fafc8cdc5c7879aa4726a28439fca7656;p=platform%2Fkernel%2Flinux-starfive.git 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 Cc: Michael Jamet Cc: Yehezkel Bernat Cc: linux-usb@vger.kernel.org Signed-off-by: Lee Jones Signed-off-by: Mika Westerberg --- diff --git a/drivers/thunderbolt/dma_port.c b/drivers/thunderbolt/dma_port.c index 847dd07a7b17..7288aaf01ae6 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;