aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/loop.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2017-06-22 10:19:14 +0200
committerIngo Molnar <mingo@kernel.org>2017-06-22 10:19:14 +0200
commitf9e169883164390a15b56d00cb7e22c2e72f4dba (patch)
tree2a946cfff76d6dd41005d0dd534e0bd97641019d /drivers/block/loop.c
parentlocking/rtmutex: Don't initialize lockdep when not required (diff)
parentMerge branch 'for-linus' of git://git.kernel.dk/linux-block (diff)
downloadlinux-f9e169883164390a15b56d00cb7e22c2e72f4dba.tar.gz
linux-f9e169883164390a15b56d00cb7e22c2e72f4dba.zip
Merge branch 'linus' into locking/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/block/loop.c')
-rw-r--r--drivers/block/loop.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 28d932906f24..ebbd0c3fe0ed 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -608,6 +608,9 @@ static int loop_switch(struct loop_device *lo, struct file *file)
*/
static int loop_flush(struct loop_device *lo)
{
+ /* loop not yet configured, no running thread, nothing to flush */
+ if (lo->lo_state != Lo_bound)
+ return 0;
return loop_switch(lo, NULL);
}