diff options
-rw-r--r-- | drivers/md/dm.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 48db308fae67..f1db689667ea 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c | |||
@@ -1777,6 +1777,10 @@ struct mapped_device *dm_get_from_kobject(struct kobject *kobj) | |||
1777 | if (&md->kobj != kobj) | 1777 | if (&md->kobj != kobj) |
1778 | return NULL; | 1778 | return NULL; |
1779 | 1779 | ||
1780 | if (test_bit(DMF_FREEING, &md->flags) || | ||
1781 | test_bit(DMF_DELETING, &md->flags)) | ||
1782 | return NULL; | ||
1783 | |||
1780 | dm_get(md); | 1784 | dm_get(md); |
1781 | return md; | 1785 | return md; |
1782 | } | 1786 | } |