summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@daterainc.com>2013-09-17 21:53:24 +0000
committerKent Overstreet <kmo@daterainc.com>2013-10-03 16:19:28 -0700
commitbcc237e8f0b95e9e6c45b340a3eb70c13013bfab (patch)
tree2ce8ccce0b72f06cfe9c3a45e130b5d64d54fd8a
parent86ba517d8ee02ddb82f4bba645d4860c7b485558 (diff)
block/test: Fix register_blk_test failure OOPsblk-flush-torture-test
Signed-off-by: Nicholas Bellinger <nab@daterainc.com>
-rw-r--r--drivers/block/test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/test.c b/drivers/block/test.c
index 66c19a942be8..f72f814131ae 100644
--- a/drivers/block/test.c
+++ b/drivers/block/test.c
@@ -277,7 +277,7 @@ out:
kfree(path);
return ret;
err:
- if (dev && dev->bdev)
+ if (dev && !IS_ERR(dev->bdev))
blkdev_put(dev->bdev, FMODE_READ|FMODE_WRITE|FMODE_EXCL);
kfree(dev);
goto out;