Skip to content

Commit ee0251a

Browse files
committed
HardwareSerial: fix begin() lock issue on error path
If the user supplied a wrong UART number, the begin() method would return without releasing the lock. Add missing unlock call.
1 parent 1c3039e commit ee0251a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cores/esp32/HardwareSerial.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,7 @@ void HardwareSerial::begin(unsigned long baud, uint32_t config, int8_t rxPin, in
367367
#endif
368368
default:
369369
log_e("Bad UART Number");
370+
HSERIAL_MUTEX_UNLOCK();
370371
return;
371372
}
372373
}

0 commit comments

Comments
 (0)