Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(122)

Unified Diff: device/hid/hid_connection_linux.cc

Issue 223803002: HID connection matches wrong hidraw devnode to HID device when a bus driver is present on Linux (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/hid/hid_connection_linux.cc
diff --git a/device/hid/hid_connection_linux.cc b/device/hid/hid_connection_linux.cc
index 503a3c55fb9f24f126681b122e9ce2577313f4be..936c7b1bd23fe95a13c2fd29453fe2119ab59089 100644
--- a/device/hid/hid_connection_linux.cc
+++ b/device/hid/hid_connection_linux.cc
@@ -232,8 +232,11 @@ bool HidConnectionLinux::FindHidrawDevNode(udev_device* parent,
std::string device_path = udev_device_get_devpath(hid_dev.get());
if (raw_path &&
!device_path.compare(0, parent_path.length(), parent_path)) {
- *result = raw_path;
- return true;
+ std::string sub_path = device_path.substr(parent_path.length());
+ if (sub_path.substr(0, sizeof(kHidrawSubsystem)-1) == kHidrawSubsystem) {
+ *result = raw_path;
+ return true;
+ }
}
}
@@ -241,3 +244,4 @@ bool HidConnectionLinux::FindHidrawDevNode(udev_device* parent,
}
} // namespace device
+
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698