提交 249e7e0f 编写于 作者: I Ian Jackson 提交者: Stefano Stabellini

cpu_ioreq_pio, cpu_ioreq_move: i should be uint32_t rather than int

The current code compare i (int) with req->count (uint32_t) in a for
loop, risking an infinite loop if req->count is equal to UINT_MAX.

Also i is only used in comparisons or multiplications with unsigned
integers.
Signed-off-by: NStefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: Dongxiao Xu <dongxiao.xu@intel.com>
Cc: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: NIan Jackson <ian.jackson@eu.citrix.com>
上级 a3864829
......@@ -721,7 +721,7 @@ static inline void write_phys_req_item(hwaddr addr,
static void cpu_ioreq_pio(ioreq_t *req)
{
int i;
uint32_t i;
if (req->dir == IOREQ_READ) {
if (!req->data_is_ptr) {
......@@ -750,7 +750,7 @@ static void cpu_ioreq_pio(ioreq_t *req)
static void cpu_ioreq_move(ioreq_t *req)
{
int i;
uint32_t i;
if (!req->data_is_ptr) {
if (req->dir == IOREQ_READ) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册