diff options
-rw-r--r-- | drivers/md/dm-ioctl.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index 777c948180f9..8da7a017b4ef 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c | |||
@@ -1550,8 +1550,10 @@ int dm_copy_name_and_uuid(struct mapped_device *md, char *name, char *uuid) | |||
1550 | goto out; | 1550 | goto out; |
1551 | } | 1551 | } |
1552 | 1552 | ||
1553 | strcpy(name, hc->name); | 1553 | if (name) |
1554 | strcpy(uuid, hc->uuid ? : ""); | 1554 | strcpy(name, hc->name); |
1555 | if (uuid) | ||
1556 | strcpy(uuid, hc->uuid ? : ""); | ||
1555 | 1557 | ||
1556 | out: | 1558 | out: |
1557 | up_read(&_hash_lock); | 1559 | up_read(&_hash_lock); |