PM / hibernate / memory hotplug: Rework mutual exclusion
[firefly-linux-kernel-4.4.55.git] / kernel / power / user.c
index 63368163e98d06bc542b40911e365e9d226f9b35..72e8f4fd616dee0cec880d442e33127602601f6c 100644 (file)
@@ -201,6 +201,7 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
        if (!mutex_trylock(&pm_mutex))
                return -EBUSY;
 
+       lock_device_hotplug();
        data = filp->private_data;
 
        switch (cmd) {
@@ -373,6 +374,7 @@ static long snapshot_ioctl(struct file *filp, unsigned int cmd,
 
        }
 
+       unlock_device_hotplug();
        mutex_unlock(&pm_mutex);
 
        return error;