Skip to content
Snippets Groups Projects
Commit 7a376b4b authored by Harvey Yang's avatar Harvey Yang
Browse files

DmaBufAllocator: Avoid syncing with an invalid file descriptor


As DmaSyncer disables the copy c'tor, the move c'tor will be used
instead. This leaves some DmaSyncers with invalid SharedFDs. They should
avoid syncing with invalid file descriptors in the d'tor.

Fixes: 545046a4 ("DmaBufAllocator: Make DmaSyncer non-copyable")
Signed-off-by: default avatarHarvey Yang <chenghaoyang@chromium.org>
parent 2ae7b2ff
No related merge requests found
Checking pipeline status
......@@ -330,6 +330,11 @@ DmaSyncer::~DmaSyncer()
void DmaSyncer::sync(uint64_t step)
{
// DmaSyncer might be moved and left an empty SharedFD.
// Avoid syncing with an invalid file descriptor in this case.
if (!fd_.isValid())
return;
struct dma_buf_sync sync = {
.flags = flags_ | step
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment