The for-loop iterates with a u8 loop counter i and compares this
with the loop upper limit of res->resets_num which is an unsigned
int type. There is a potential infinite loop if res->resets_num
is larger than the u8 loop counter i. Fix this by making the loop
counter the same type as res->resets_num.
Addresses-Coverity: ("Infinite loop")
Fixes: 3bca43585e22 ("media: venus: core,pm: Add handling for resets")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
static int core_resets_reset(struct venus_core *core)
{
const struct venus_resources *res = core->res;
- unsigned char i;
+ unsigned int i;
int ret;
if (!res->resets_num)
{
struct device *dev = core->dev;
const struct venus_resources *res = core->res;
- unsigned char i;
+ unsigned int i;
int ret;
if (!res->resets_num)