Skip to content

Commit 6e07f60

Browse files
committed
mount: don't call sd_device_get_property_value() with a NULL pointer
Otherwise bad thing would've happened is this was a hard assert: + systemd-mount --umount /dev/loop0 Assertion 'device' failed at src/libsystemd/sd-device/sd-device.c:2202, function sd_device_get_property_value(). Ignoring.
1 parent 17122c3 commit 6e07f60

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/mount/mount-tool.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -975,15 +975,14 @@ static int stop_mounts(
975975
}
976976

977977
static int umount_by_device(sd_bus *bus, sd_device *dev) {
978-
_cleanup_(sd_device_unrefp) sd_device *d = NULL;
979978
_cleanup_strv_free_ char **list = NULL;
980979
const char *v;
981980
int r, ret = 0;
982981

983982
assert(bus);
984983
assert(dev);
985984

986-
if (sd_device_get_property_value(d, "SYSTEMD_MOUNT_WHERE", &v) >= 0)
985+
if (sd_device_get_property_value(dev, "SYSTEMD_MOUNT_WHERE", &v) >= 0)
987986
ret = stop_mounts(bus, v);
988987

989988
r = sd_device_get_devname(dev, &v);

0 commit comments

Comments
 (0)