video4linux2.c: do not close before open.

With no camera connected this would call close(0), causing  problems later.
This commit is contained in:
j0ki 2025-06-04 15:47:57 +02:00 committed by GitHub
parent 4b7806afe7
commit bdd80921b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -310,7 +310,8 @@ static void *v4l_init(const char *device, uint64_t caps,
if (!path_is_character_special(v4l->dev_name))
{
RARCH_ERR("[V4L2]: %s is no device.\n", v4l->dev_name);
goto error;
free(v4l);
return NULL;
}
v4l->fd = open(v4l->dev_name, O_RDWR | O_NONBLOCK, 0);