summaryrefslogtreecommitdiff
path: root/src/udev
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-12-03 20:00:28 +0100
committerTom Gundersen <teg@jklm.no>2014-12-03 21:36:10 +0100
commit523c620bcd657f22cb52e6b78881cbb1f7d6832a (patch)
tree0e2cad3c65d0964832f3c353f85391ebbe06457e /src/udev
parent98940a3cd93807b5a3809bb1fb7ab43d450939f1 (diff)
udevd: don't take reference for NULL rtnl object
Diffstat (limited to 'src/udev')
-rw-r--r--src/udev/udevd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index ab2b4ba611..6a8dda3272 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -315,8 +315,9 @@ static void worker_new(struct event *event) {
arg_event_timeout_usec, arg_event_timeout_warn_usec,
&sigmask_orig);
- /* in case rtnl was initialized */
- rtnl = sd_rtnl_ref(udev_event->rtnl);
+ if (udev_event->rtnl)
+ /* in case rtnl was initialized */
+ rtnl = sd_rtnl_ref(udev_event->rtnl);
/* apply/restore inotify watch */
if (udev_event->inotify_watch) {