diff options
Diffstat (limited to 'drivers/md/dm-ioctl.c')
-rw-r--r-- | drivers/md/dm-ioctl.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index d13bb15a8a02..4510ad8f971c 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c | |||
@@ -606,9 +606,14 @@ static struct hash_cell *__find_device_hash_cell(struct dm_ioctl *param) | |||
606 | return __get_name_cell(param->name); | 606 | return __get_name_cell(param->name); |
607 | 607 | ||
608 | md = dm_get_md(huge_decode_dev(param->dev)); | 608 | md = dm_get_md(huge_decode_dev(param->dev)); |
609 | if (md) | 609 | if (!md) |
610 | mdptr = dm_get_mdptr(md); | 610 | goto out; |
611 | 611 | ||
612 | mdptr = dm_get_mdptr(md); | ||
613 | if (!mdptr) | ||
614 | dm_put(md); | ||
615 | |||
616 | out: | ||
612 | return mdptr; | 617 | return mdptr; |
613 | } | 618 | } |
614 | 619 | ||