char: cadence: check baud rate generator and divider values
commit6e29651c5e3a0e0336818574f273b3f6ecea491d
authorPrasad J Pandit <pjp@fedoraproject.org>
Mon, 7 Nov 2016 10:00:24 +0000 (7 10:00 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Mon, 7 Nov 2016 10:00:24 +0000 (7 10:00 +0000)
treecac5e9d74f007697377fab6d54e6fbe0f2267d82
parent9226682a401f34b10fd79dfe17ba334da0800747
char: cadence: check baud rate generator and divider values

The Cadence UART device emulator calculates speed by dividing the
baud rate by a 'baud rate generator' & 'baud rate divider' value.
The device specification defines these register values to be
non-zero and within certain limits. Add checks for these limits
to avoid errors like divide by zero.

Reported-by: Huawei PSIRT <psirt@huawei.com>
Signed-off-by: Prasad J Pandit <pjp@fedoraproject.org>
Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>
Message-id: 1477596278-1470-1-git-send-email-ppandit@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
hw/char/cadence_uart.c