diff --git a/src/libcamera/v4l2_videodevice.cpp b/src/libcamera/v4l2_videodevice.cpp index fbe55bc6f..3614b2ed1 100644 --- a/src/libcamera/v4l2_videodevice.cpp +++ b/src/libcamera/v4l2_videodevice.cpp @@ -1276,14 +1276,7 @@ FileDescriptor V4L2VideoDevice::exportDmabufFd(unsigned int index, return FileDescriptor(); } - FileDescriptor fd(expbuf.fd); - /* - * FileDescriptor takes a duplicate of fd, so we must close the - * original here, otherwise it will be left dangling. - */ - ::close(expbuf.fd); - - return fd; + return FileDescriptor(std::move(expbuf.fd)); } /**