[PATCH openEuler-1.0-LTS 162/316] serial_core: Check for port state when tty is in error state