logind-core: drop unneeded check for NULL

This commit is contained in:
David Tardon
2023-04-27 21:42:38 +02:00
parent 737e0f12d9
commit 3d01bfa7db
+3 -7
View File
@@ -323,15 +323,11 @@ int manager_process_button_device(Manager *m, sd_device *d) {
return r;
if (device_for_action(d, SD_DEVICE_REMOVE) ||
sd_device_has_current_tag(d, "power-switch") <= 0) {
sd_device_has_current_tag(d, "power-switch") <= 0)
b = hashmap_get(m->buttons, sysname);
if (!b)
return 0;
button_free(hashmap_get(m->buttons, sysname));
button_free(b);
} else {
else {
const char *sn;
r = manager_add_button(m, sysname, &b);