From: Milan Broz 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 --- drivers/md/dm-ioctl.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) Index: linux-2.6.28/drivers/md/dm-ioctl.c =================================================================== --- linux-2.6.28.orig/drivers/md/dm-ioctl.c 2009-01-05 17:40:34.000000000 +0000 +++ linux-2.6.28/drivers/md/dm-ioctl.c 2009-01-05 18:18:24.000000000 +0000 @@ -1550,8 +1550,10 @@ int dm_copy_name_and_uuid(struct mapped_ 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);