Fix fdsan check
BUG: 140376618
Test: Downloaded a picture on Chrome (this would crash previously)
Change-Id: I7a750cde1131d19d140140dfaa0bd09131974fc0
diff --git a/model/VolumeBase.cpp b/model/VolumeBase.cpp
index d6e4288..08da8f6 100644
--- a/model/VolumeBase.cpp
+++ b/model/VolumeBase.cpp
@@ -149,7 +149,7 @@
return -EBUSY;
}
- mFuseFd.reset(std::move(fuseFd.get()));
+ mFuseFd = std::move(fuseFd);
return OK;
}
diff --git a/model/VolumeBase.h b/model/VolumeBase.h
index 6afb88e..5deecdb 100644
--- a/model/VolumeBase.h
+++ b/model/VolumeBase.h
@@ -122,6 +122,7 @@
status_t setId(const std::string& id);
status_t setPath(const std::string& path);
status_t setInternalPath(const std::string& internalPath);
+ // Takes ownership of the fd passed in.
status_t setFuseFd(android::base::unique_fd fuseFd);
android::sp<android::os::IVoldListener> getListener() const;