From: Milan Broz Date: Tue, 6 Jan 2009 03:05:04 +0000 (+0000) Subject: dm ioctl: allow dm_copy_name_and_uuid to return only one field X-Git-Tag: v2.6.29-rc1~492^2~10 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=23d39f63aa87e812fd879b8bc32ee6ccfe733de3;p=linux-2.6-omap-h63xx.git dm ioctl: allow dm_copy_name_and_uuid to return only one field Allow NULL buffer in dm_copy_name_and_uuid if you only want to return one of the fields. (Required by a following patch that adds these fields to sysfs.) Signed-off-by: Milan Broz Reviewed-by: Alasdair G Kergon Signed-off-by: Alasdair G Kergon --- diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index 777c948180f..8da7a017b4e 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) goto out; } - strcpy(name, hc->name); - strcpy(uuid, hc->uuid ? : ""); + if (name) + strcpy(name, hc->name); + if (uuid) + strcpy(uuid, hc->uuid ? : ""); out: up_read(&_hash_lock);