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
* 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