tty: serial: msm_geni_serial: Fix the race condition during RX

When RX operation gets aborted due to port shutdown, already initiated
RX operation does not check the state of the Serial Enginer and the
validity of the buffer. This leads to use-after-free scenario.

Ensure that the secondary Serial Engine is active and RX buffer is valid
before accessing it. Also disable the IRQ before stopping the TX & RX
operations.

CRs-Fixed: 2092627
Change-Id: Ib3195ef4f5d50938deaf39e604d2f5a533b7892e
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
1 file changed