hw/char/sh_serial: use rx_cnt for available FIFO space

sh_serial_can_receive() used rx_head (the circular buffer write pointer)
to compute available space. Since rx_head wraps around, this could
overestimate or underestimate the remaining capacity.  Use rx_cnt, which
tracks the actual number of buffered bytes.

Reported-by: Pavee Hui <phui@google.com>
Fixes: 543671d9907f ("hw/char/sh_serial: Return correct number of empty RX FIFO elements")
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Yoshinori Sato <yoshinori.sato@nifty.com>
Message-ID: <20261004-issue-4560-v1-37-ccbef537cbeb@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
1 file changed