Commit bdef99cd authored by Maksim Ivanov's avatar Maksim Ivanov Committed by Chromium LUCI CQ

Fix double-callback-call crash in //services/device/hid/

Fix use-after-move (potential) bugs found by the
"bugprone-use-after-move" clang-tidy check.

Bug: 1122844
Change-Id: Ifbac49491ff181550f23b4bd611eb0f28e470688
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2602289
Auto-Submit: Maksim Ivanov <emaxx@chromium.org>
Commit-Queue: Matt Reynolds <mattreynolds@chromium.org>
Reviewed-by: default avatarMatt Reynolds <mattreynolds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#840349}
parent c83fe85c
......@@ -149,6 +149,7 @@ void HidConnectionWin::PlatformWrite(
if (!IsValidHandle(file_handle)) {
HID_LOG(DEBUG) << "HID write failed due to invalid handle.";
std::move(callback).Run(false);
return;
}
transfers_.push_back(std::make_unique<PendingHidTransfer>(
......@@ -170,6 +171,7 @@ void HidConnectionWin::PlatformGetFeatureReport(uint8_t report_id,
if (!IsValidHandle(file_handle)) {
HID_LOG(DEBUG) << "HID read failed due to invalid handle.";
std::move(callback).Run(false, nullptr, 0);
return;
}
transfers_.push_back(std::make_unique<PendingHidTransfer>(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment