From: Josh Gao Date: Wed, 18 Mar 2020 02:27:13 +0000 (-0700) Subject: thermal: Fix bugprone-use-after-move. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=998e4cfbfb6912a4e7d9bd562a02a45e41798cf3;p=GitHub%2FLineageOS%2Fandroid_hardware_samsung.git thermal: Fix bugprone-use-after-move. fd was moved out of, so we were adding -1 to the looper. Bug: http://b/150783499 Test: treehugger (cherry picked from commit 56ed76601d2fa5f1a1e6f7f24d79975a69f43a39) Change-Id: Ib571f32078fd9adb91a1e619110330583b75482b --- diff --git a/hidl/thermal/utils/thermal_watcher.cpp b/hidl/thermal/utils/thermal_watcher.cpp index 0298216..08a7e39 100644 --- a/hidl/thermal/utils/thermal_watcher.cpp +++ b/hidl/thermal/utils/thermal_watcher.cpp @@ -47,8 +47,8 @@ void ThermalWatcher::registerFilesToWatch(const std::set &sensors_t continue; } watch_to_file_path_map_.emplace(fd.get(), path); - fds_.emplace_back(std::move(fd)); looper_->addFd(fd.get(), 0, Looper::EVENT_INPUT, nullptr, nullptr); + fds_.emplace_back(std::move(fd)); } monitored_sensors_.insert(sensors_to_watch.begin(), sensors_to_watch.end()); if (!uevent_monitor) {