diff --git a/client/src/uart/uart_posix.c b/client/src/uart/uart_posix.c index b864da4b1..ff2a6cde3 100644 --- a/client/src/uart/uart_posix.c +++ b/client/src/uart/uart_posix.c @@ -509,6 +509,10 @@ int uart_receive(const serial_port sp, uint8_t *pbtRx, uint32_t pszMaxRxLen, uin res = read(spu->fd, transitBuf, RingBuf_getAvailableSize(spu->udpBuffer)); RingBuf_enqueueBatch(spu->udpBuffer, transitBuf, res); } + // Stop if the OS has some troubles reading the data + if (res < 0) { + return PM3_EIO; + } continue; }