1
0
mirror of https://github.com/systemd/systemd synced 2026-04-26 17:04:50 +02:00

Compare commits

...

2 Commits

Author SHA1 Message Date
Daan De Meyer
b1ba0ce800 core/device: Use DEVICE_NOT_FOUND instead of 0.
Use the enum name instead of the value zero. This is a noop change
as DEVICE_NOT_FOUND == 0.
2022-05-07 20:05:10 +01:00
Jan Janssen
f7ae43795c boot: Fix null pointer dereference 2022-05-07 21:56:06 +09:00
4 changed files with 6 additions and 6 deletions

View File

@ -1916,7 +1916,7 @@ static ConfigEntry *config_entry_add_loader(
.device = device,
.loader = xstrdup(loader),
.id = xstrdup(id),
.sort_key = xstrdup(sort_key),
.sort_key = sort_key ? xstrdup(sort_key) : NULL,
.key = key,
.tries_done = UINTN_MAX,
.tries_left = UINTN_MAX,

View File

@ -885,7 +885,7 @@ static void device_remove_old_on_move(Manager *m, sd_device *dev) {
if (!syspath_old)
return (void) log_oom();
device_update_found_by_sysfs(m, syspath_old, 0, DEVICE_FOUND_MASK);
device_update_found_by_sysfs(m, syspath_old, DEVICE_NOT_FOUND, DEVICE_FOUND_MASK);
}
static int device_dispatch_io(sd_device_monitor *monitor, sd_device *dev, void *userdata) {
@ -924,7 +924,7 @@ static int device_dispatch_io(sd_device_monitor *monitor, sd_device *dev, void *
/* If we get notified that a device was removed by udev, then it's completely gone, hence
* unset all found bits */
device_update_found_by_sysfs(m, sysfs, 0, DEVICE_FOUND_MASK);
device_update_found_by_sysfs(m, sysfs, DEVICE_NOT_FOUND, DEVICE_FOUND_MASK);
} else if (device_is_ready(dev)) {
@ -941,7 +941,7 @@ static int device_dispatch_io(sd_device_monitor *monitor, sd_device *dev, void *
} else
/* The device is nominally around, but not ready for us. Hence unset the udev bit, but leave
* the rest around. */
device_update_found_by_sysfs(m, sysfs, 0, DEVICE_FOUND_UDEV);
device_update_found_by_sysfs(m, sysfs, DEVICE_NOT_FOUND, DEVICE_FOUND_UDEV);
return 0;
}

View File

@ -2070,7 +2070,7 @@ static int mount_process_proc_self_mountinfo(Manager *m) {
continue;
/* Let the device units know that the device is no longer mounted */
device_found_node(m, what, 0, DEVICE_FOUND_MOUNT);
device_found_node(m, what, DEVICE_NOT_FOUND, DEVICE_FOUND_MOUNT);
}
return 0;

View File

@ -1249,7 +1249,7 @@ static int swap_process_proc_swaps(Manager *m) {
}
if (swap->what)
device_found_node(m, swap->what, 0, DEVICE_FOUND_SWAP);
device_found_node(m, swap->what, DEVICE_NOT_FOUND, DEVICE_FOUND_SWAP);
} else if (swap->just_activated) {