TIOCSERGETLSR bug in serial-5.05
Brought to you by:
tytso
The get_lsr_info() function used to get the result for
the TIOCSERGETLSR ioctl has a bug. The line that reads:
result &= TIOCSER_TEMT;
should read:
result |= TIOCSER_TEMT;
The effect of the bug is to render the second condition
for returning with the TIOCSER_TEMT bit set in the
result ineffective. (The first condition is checking if
the UART's transmitter is idle; the second condition is
checking if the UART's THR register is about to be
written.)
I have submitted a patch (Patch #427320) to fix this
bug.
Logged In: YES
user_id=141198
IMPORTANT!!
I mucked it up. The line should read as follows:
result &= ~TIOCSER_TEMT;
I.e. we want to clear the TIOCSER_TEMT bit in the result if
the second condition is true, NOT set it!
Please use the revised version of the patch, not the
original. The revised version is called
'patch-serial-5.05-ija-get_lsr_info-2'. Patch #427320 shows
both versions.
I'll attach the updated version to this message as well just
to make sure!
Revised serial 5.05 patch to fix TIOCSETGETLSR bug