summaryrefslogtreecommitdiff
path: root/udev/lib/libudev-device.c
diff options
context:
space:
mode:
authorKay Sievers <kay.sievers@vrfy.org>2008-11-14 18:26:49 +0100
committerKay Sievers <kay.sievers@vrfy.org>2008-11-14 18:26:49 +0100
commitf454ecf7544077349c24e9fcfd418dbfca927063 (patch)
tree0f8a333051a94930448caf88f045a1e76d4390fb /udev/lib/libudev-device.c
parent4dfe61c9668a0f6528de14ec413fce06be0b575c (diff)
libudev: device - handle disk "device" link for partitions in deprecated sysfs layout
Thanks to Mikhail Kolesnik <mike@openbunker.org> for finding this.
Diffstat (limited to 'udev/lib/libudev-device.c')
-rw-r--r--udev/lib/libudev-device.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/udev/lib/libudev-device.c b/udev/lib/libudev-device.c
index eda3f5d97e..c4714e4088 100644
--- a/udev/lib/libudev-device.c
+++ b/udev/lib/libudev-device.c
@@ -501,9 +501,11 @@ static struct udev_device *device_new_from_parent(struct udev_device *udev_devic
strncmp(udev_device->devpath, "/block/", 7) == 0) {
util_strlcpy(path, udev_device->syspath, sizeof(path));
util_strlcat(path, "/device", sizeof(path));
- if (util_resolve_sys_link(udev_device->udev, path, sizeof(path)) == 0)
+ if (util_resolve_sys_link(udev_device->udev, path, sizeof(path)) == 0) {
udev_device_parent = udev_device_new_from_syspath(udev_device->udev, path);
- return udev_device_parent;
+ if (udev_device_parent != NULL)
+ return udev_device_parent;
+ }
}
util_strlcpy(path, udev_device->syspath, sizeof(path));