Skip to content

Commit

Permalink
drivers: i2s: nrfx: fix incorrect direction check
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
gmarull authored and nashif committed Aug 26, 2021
1 parent 437f7f9 commit 086cfb3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/i2s/i2s_nrfx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down

0 comments on commit 086cfb3

Please sign in to comment.