1
0
Fork 0
mirror of https://github.com/linux-usb-gadgets/libusbgx.git synced 2025-07-26 03:45:06 +03:00

uvc: fix init_formats function

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>
This commit is contained in:
Michael Grzeschik 2022-06-27 01:21:26 +02:00
parent afec0d6e71
commit 50fe6a79bc

View file

@ -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;
}