diff options
author | Ben Chan <benchan@chromium.org> | 2017-03-02 18:57:14 -0800 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2017-03-03 07:26:59 +0100 |
commit | f0cda2093078d630ca164b3872f742609e091a20 (patch) | |
tree | c4075f0b6982c51803248dc0ba5b38571f61f177 /src/mm-device.c | |
parent | 8c3312918adf8ba49bb242cd21b306d3a7ff3a09 (diff) |
kernel-device: use device sysfs if physdev sysfs isn't available
find_device_by_physdev_uid() expects a non-NULL UID of the physical
device. However, mm_kernel_device_get_physdev_uid() could potentially
return NULL on MMKernelDeviceUdev if find_physical_gudevdevice() in
mm-kernel-device-udev.c fails to find the physical device. When a NULL
physical device UID is passed to find_device_by_physdev_uid() and used
in g_hash_table_lookup(), it leads to a crash in g_str_hash(), which is
a bit obscure.
This patch updates kernel_device_get_physdev_uid() in
mm-kernel-device-udev.c to fall back to use the device sysfs if the
physical device sysfs isn't available, which is similar to how
kernel_device_get_physdev_uid() mm-kernel-device-generic.c is
implemented.
Diffstat (limited to 'src/mm-device.c')
0 files changed, 0 insertions, 0 deletions