From 086cfb3913f70f071ecf211ad0303be2b8dd1658 Mon Sep 17 00:00:00 2001 From: Gerard Marull-Paretas Date: Thu, 26 Aug 2021 09:04:59 +0200 Subject: [PATCH] drivers: i2s: nrfx: fix incorrect direction check I2S direction was not checked correctly in the i2s_nrfx_configure function. This patch also fixes coverity issue 238365. Signed-off-by: Gerard Marull-Paretas --- drivers/i2s/i2s_nrfx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/i2s/i2s_nrfx.c b/drivers/i2s/i2s_nrfx.c index 2f75b5ac3a1..c4f1e57d30a 100644 --- a/drivers/i2s/i2s_nrfx.c +++ b/drivers/i2s/i2s_nrfx.c @@ -399,11 +399,11 @@ static int i2s_nrfx_configure(const struct device *dev, enum i2s_dir dir, if (i2s_cfg->frame_clk_freq == 0) { /* -> reset state */ purge_queue(dev, dir); - if (dir == I2S_DIR_TX || I2S_DIR_BOTH) { + if (dir == I2S_DIR_TX || dir == I2S_DIR_BOTH) { drv_data->tx_configured = false; memset(&drv_data->tx, 0, sizeof(drv_data->tx)); } - if (dir == I2S_DIR_RX || I2S_DIR_BOTH) { + if (dir == I2S_DIR_RX || dir == I2S_DIR_BOTH) { drv_data->rx_configured = false; memset(&drv_data->rx, 0, sizeof(drv_data->rx)); }