dev_set_name will use sprintf to copy the name. need to check if the name does valid. otherwise will error from device_add later. v2: add %s in dev_set_name according to James Signed-off-by: Yinghai Lu <yinghai@xxxxxxxxxx> --- drivers/misc/enclosure.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Index: linux-2.6/drivers/misc/enclosure.c =================================================================== --- linux-2.6.orig/drivers/misc/enclosure.c +++ linux-2.6/drivers/misc/enclosure.c @@ -119,7 +119,7 @@ enclosure_register(struct device *dev, c edev->edev.class = &enclosure_class; edev->edev.parent = get_device(dev); edev->cb = cb; - dev_set_name(&edev->edev, name); + dev_set_name(&edev->edev, "%s", name); err = device_register(&edev->edev); if (err) goto err; @@ -255,8 +255,8 @@ enclosure_component_register(struct encl ecomp->number = number; cdev = &ecomp->cdev; cdev->parent = get_device(&edev->edev); - if (name) - dev_set_name(cdev, name); + if (name && name[0]) + dev_set_name(cdev, "%s", name); else dev_set_name(cdev, "%u", number); -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html