]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev: fix usage of udev_device_new_from_stat_rdev() in journalctl
authorFilipe Brandenburger <filbranden@google.com>
Thu, 7 Jun 2018 20:07:56 +0000 (13:07 -0700)
committerLennart Poettering <lennart@poettering.net>
Thu, 7 Jun 2018 22:45:22 +0000 (00:45 +0200)
The refactor in #9200 inadvertently dropped the variable assignment to
traverse the device and its hierarchy in add_matches_for_device().

This was uncovered by Coverity (CID #1393310).

Fix that by restoring the assignment.

Tested: `journalctl /dev/sda` now filters journalctl output again.

src/journal/journalctl.c

index 9ad1b31fa344e30b4d1381bcb3f896079e20d8d6..696abcd4505709fc3a1cda6a2f63dbf1b668128c 100644 (file)
@@ -207,6 +207,7 @@ static int add_matches_for_device(sd_journal *j, const char *devpath) {
         if (r < 0)
                 return log_error_errno(r, "Failed to get udev device from devnum %u:%u: %m", major(st.st_rdev), minor(st.st_rdev));
 
+        d = device;
         while (d) {
                 _cleanup_free_ char *match = NULL;
                 const char *subsys, *sysname, *devnode;