disk: Fix usdhc driver out-of-bounds array access
The usdhc driver was incorrectly post-decrementing a do/while loop iterator, causing an extra iteration of the loop and an out-of-bounds array access. Change the iterator to decrement within the loop instead. Tested samples/subsys/fs/fat_fs on the mimxrt1050_evk board. Coverity-CID: 203403 Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
This commit is contained in:
parent
47f36afdb9
commit
aa9b762d12
|
@ -1101,7 +1101,8 @@ static int usdhc_cmd_rsp(struct usdhc_priv *priv)
|
|||
((cmd->response[i - 2U] &
|
||||
0xFF000000U) >> 24U);
|
||||
}
|
||||
} while (i--);
|
||||
i--;
|
||||
} while (i);
|
||||
}
|
||||
}
|
||||
/* check response error flag */
|
||||
|
|
Loading…
Reference in a new issue