Skip to content

Commit

Permalink
uvc: fix init_formats function
Browse files Browse the repository at this point in the history
The return value of scandir is used in init_frames to iterate over
the elements. The iteration is done over nmb not ret. So this patch
is fixing this to fill the right variable.

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
  • Loading branch information
mgrzeschik committed Jul 11, 2022
1 parent afec0d6 commit 50fe6a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/function/uvc.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ int init_frames(struct usbg_f_uvc *uvc, int j)
return ret;
}

ret = scandir(fpath, &dent, frame_select, frame_sort);
if (ret < 0) {
nmb = scandir(fpath, &dent, frame_select, frame_sort);
if (nmb < 0) {
ret = usbg_translate_error(errno);
return ret;
}
Expand Down

0 comments on commit 50fe6a7

Please sign in to comment.