device-handler: Don't unmount non-mounted devices
[petitboot] / discover / device-handler.c
index 08e3d74651e7e1426ed3c8e6c8032955917379d1..6952ddefa6387b18d6f60120b7ba621ca7eae342 100644 (file)
@@ -240,6 +240,9 @@ static int umount_device(struct discover_device *dev)
 
        remove_device_links(dev);
 
+       if (!dev->mount_path)
+               return 0;
+
        pid = fork();
        if (pid == -1) {
                pb_log("%s: fork failed: %s\n", __func__, strerror(errno));