From 157cbd83c6c077aeca1bab17089419675cca8e35 Mon Sep 17 00:00:00 2001 From: Michael Grzeschik Date: Thu, 28 Oct 2021 00:39:47 +0200 Subject: [PATCH] uvc: fix return check on scandir The function init_frames is falsely checking for the negative result from scandir on an unsigned variable. This will never be true. Signed-off-by: Michael Grzeschik --- src/function/uvc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/function/uvc.c b/src/function/uvc.c index 5c19842..cad4971 100644 --- a/src/function/uvc.c +++ b/src/function/uvc.c @@ -174,8 +174,8 @@ int init_frames(struct usbg_f_uvc *uvc, int j) return ret; } - nmb = scandir(fpath, &dent, frame_select, frame_sort); - if (nmb < 0) { + ret = scandir(fpath, &dent, frame_select, frame_sort); + if (ret < 0) { ret = usbg_translate_error(errno); return ret; }