aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/input/input.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/input/input.c b/drivers/input/input.c
index 0e2e890c0988..ceaed631d49f 100644
--- a/drivers/input/input.c
+++ b/drivers/input/input.c
@@ -475,17 +475,21 @@ static int input_devices_read(char *buf, char **start, off_t pos, int count, int
475{ 475{
476 struct input_dev *dev; 476 struct input_dev *dev;
477 struct input_handle *handle; 477 struct input_handle *handle;
478 const char *path;
478 479
479 off_t at = 0; 480 off_t at = 0;
480 int i, len, cnt = 0; 481 int i, len, cnt = 0;
481 482
482 list_for_each_entry(dev, &input_dev_list, node) { 483 list_for_each_entry(dev, &input_dev_list, node) {
483 484
485 path = dev->dynalloc ? kobject_get_path(&dev->cdev.kobj, GFP_KERNEL) : NULL;
486
484 len = sprintf(buf, "I: Bus=%04x Vendor=%04x Product=%04x Version=%04x\n", 487 len = sprintf(buf, "I: Bus=%04x Vendor=%04x Product=%04x Version=%04x\n",
485 dev->id.bustype, dev->id.vendor, dev->id.product, dev->id.version); 488 dev->id.bustype, dev->id.vendor, dev->id.product, dev->id.version);
486 489
487 len += sprintf(buf + len, "N: Name=\"%s\"\n", dev->name ? dev->name : ""); 490 len += sprintf(buf + len, "N: Name=\"%s\"\n", dev->name ? dev->name : "");
488 len += sprintf(buf + len, "P: Phys=%s\n", dev->phys ? dev->phys : ""); 491 len += sprintf(buf + len, "P: Phys=%s\n", dev->phys ? dev->phys : "");
492 len += sprintf(buf + len, "S: Sysfs=%s\n", path ? path : "");
489 len += sprintf(buf + len, "H: Handlers="); 493 len += sprintf(buf + len, "H: Handlers=");
490 494
491 list_for_each_entry(handle, &dev->h_list, d_node) 495 list_for_each_entry(handle, &dev->h_list, d_node)
@@ -516,6 +520,8 @@ static int input_devices_read(char *buf, char **start, off_t pos, int count, int
516 if (cnt >= count) 520 if (cnt >= count)
517 break; 521 break;
518 } 522 }
523
524 kfree(path);
519 } 525 }
520 526
521 if (&dev->node == &input_dev_list) 527 if (&dev->node == &input_dev_list)