diff options
author | jracle@logitech.com <jracle@logitech.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-03 19:26:36 +0000 |
---|---|---|
committer | jracle@logitech.com <jracle@logitech.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-03 19:26:36 +0000 |
commit | 36c936af357f4ca7a05475fb4b5f69e9be2b214c (patch) | |
tree | 0828dcf2836a1705e8d83a48b4bd5609752920e6 /device/hid/hid_connection_linux.cc | |
parent | 17f2ec7d74dfd7d45aa78d68b1554732cdf7501a (diff) | |
download | chromium_src-36c936af357f4ca7a05475fb4b5f69e9be2b214c.zip chromium_src-36c936af357f4ca7a05475fb4b5f69e9be2b214c.tar.gz chromium_src-36c936af357f4ca7a05475fb4b5f69e9be2b214c.tar.bz2 |
HID connection matches wrong hidraw devnode to HID device when a bus driver is present on Linux
Fix : HidConnectionLinux::FindHidrawDevNode should look for presence of
"hidraw" string immediately after matching parent udev path, so that we
do not match devnodes created by bus enumerator driver
BUG=358666
TBR=rockot@chromium.org
Review URL: https://codereview.chromium.org/223803002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261502 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'device/hid/hid_connection_linux.cc')
-rw-r--r-- | device/hid/hid_connection_linux.cc | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/device/hid/hid_connection_linux.cc b/device/hid/hid_connection_linux.cc index 503a3c5..936c7b1 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 + |