diff --git a/arch/arm64/src/imx9/imx9_lpi2c.c b/arch/arm64/src/imx9/imx9_lpi2c.c index e9fc37b1edc1e..1d662986e24d5 100644 --- a/arch/arm64/src/imx9/imx9_lpi2c.c +++ b/arch/arm64/src/imx9/imx9_lpi2c.c @@ -1576,7 +1576,7 @@ static int imx9_lpi2c_isr_process(struct imx9_lpi2c_priv_s *priv) /* Check if there are received bytes */ - else if ((status & LPI2C_MSR_RDF) != 0) + else if ((status & LPI2C_MSR_RDF) != 0 && priv->dcnt > 0) { imx9_lpi2c_traceevent(priv, I2CEVENT_RCVBYTE, priv->dcnt);