diff options
author | Franck Bui <fbui@suse.com> | 2017-01-10 09:11:34 +0100 |
---|---|---|
committer | Martin Pitt <martin.pitt@ubuntu.com> | 2017-01-10 09:11:34 +0100 |
commit | d13489e2be3e698616b1da3c8267709115d3d099 (patch) | |
tree | 8206b1d0e4b4e69ff59448bf88457caab8c84dbe /src/core | |
parent | 91b8fd3cadc65b9d62a272bf5095d1ea9299d9e5 (diff) |
core: make sure to not call device_is_bound_by_mounts() when dev is null (#5033)
device_setup_unit() might be called (when an event happened in
/proc/self/mountinfo for example) with a null 'dev' parameter. This
indicates that the device has been unplugged but the corresponding
mountpoint is still visible in /proc/self/mountinfo.
This patch makes sure we don't call device_is_bound_by_mounts() in
this case.
Fixes: #5025
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/device.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/device.c b/src/core/device.c index bd481c8050..0e67c96552 100644 --- a/src/core/device.c +++ b/src/core/device.c @@ -385,7 +385,7 @@ static int device_setup_unit(Manager *m, struct udev_device *dev, const char *pa * on its radar. In this case the device unit is partially initialized * and includes the deps on the mount unit but at that time the "bind * mounts" flag wasn't not present. Fix this up now. */ - if (device_is_bound_by_mounts(u, dev)) + if (dev && device_is_bound_by_mounts(u, dev)) device_upgrade_mount_deps(u); /* Note that this won't dispatch the load queue, the caller |