diff options
author | Filipe Brandenburger <filbranden@google.com> | 2018-06-07 22:07:56 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2018-06-08 00:45:22 +0200 |
commit | fffafb2b5e521476bdd911ed0cc64909cfc0cf5f (patch) | |
tree | 4fee765908308f1ff040ee1130bb56e1c6c114ef | |
parent | Merge pull request #9218 from systemd/finalize-coverity (diff) | |
download | systemd-fffafb2b5e521476bdd911ed0cc64909cfc0cf5f.tar.xz systemd-fffafb2b5e521476bdd911ed0cc64909cfc0cf5f.zip |
udev: fix usage of udev_device_new_from_stat_rdev() in journalctl
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.
-rw-r--r-- | src/journal/journalctl.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c index 9ad1b31fa3..696abcd450 100644 --- a/src/journal/journalctl.c +++ b/src/journal/journalctl.c @@ -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; |