]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev: use ASSERT_PTR() at one more place 25136/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 25 Oct 2022 19:52:06 +0000 (04:52 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 25 Oct 2022 19:52:06 +0000 (04:52 +0900)
src/udev/udev-event.c

index 42b480ca6b198fa97157af54cae81eb3aac3eede..454139c8820b129260d9e053c18f7064934f4bb2 100644 (file)
@@ -1038,11 +1038,9 @@ int udev_event_execute_rules(
         sd_device *dev;
         int r;
 
-        assert(event);
+        dev = ASSERT_PTR(ASSERT_PTR(event)->dev);
         assert(rules);
 
-        dev = event->dev;
-
         r = sd_device_get_action(dev, &action);
         if (r < 0)
                 return log_device_error_errno(dev, r, "Failed to get ACTION: %m");
@@ -1051,7 +1049,7 @@ int udev_event_execute_rules(
                 return event_execute_rules_on_remove(event, inotify_fd, timeout_usec, timeout_signal, properties_list, rules);
 
         /* Disable watch during event processing. */
-        r = udev_watch_end(inotify_fd, event->dev);
+        r = udev_watch_end(inotify_fd, dev);
         if (r < 0)
                 log_device_warning_errno(dev, r, "Failed to remove inotify watch, ignoring: %m");