aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/parport/procfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/parport/procfs.c')
-rw-r--r--drivers/parport/procfs.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/parport/procfs.c b/drivers/parport/procfs.c
index 3f56bc086cb5..92ed045a5f93 100644
--- a/drivers/parport/procfs.c
+++ b/drivers/parport/procfs.c
@@ -476,10 +476,9 @@ int parport_proc_register(struct parport *port)
476 struct parport_sysctl_table *t; 476 struct parport_sysctl_table *t;
477 int i; 477 int i;
478 478
479 t = kmalloc(sizeof(*t), GFP_KERNEL); 479 t = kmemdup(&parport_sysctl_template, sizeof(*t), GFP_KERNEL);
480 if (t == NULL) 480 if (t == NULL)
481 return -ENOMEM; 481 return -ENOMEM;
482 memcpy(t, &parport_sysctl_template, sizeof(*t));
483 482
484 t->device_dir[0].extra1 = port; 483 t->device_dir[0].extra1 = port;
485 484
@@ -523,10 +522,9 @@ int parport_device_proc_register(struct pardevice *device)
523 struct parport_device_sysctl_table *t; 522 struct parport_device_sysctl_table *t;
524 struct parport * port = device->port; 523 struct parport * port = device->port;
525 524
526 t = kmalloc(sizeof(*t), GFP_KERNEL); 525 t = kmemdup(&parport_device_sysctl_template, sizeof(*t), GFP_KERNEL);
527 if (t == NULL) 526 if (t == NULL)
528 return -ENOMEM; 527 return -ENOMEM;
529 memcpy(t, &parport_device_sysctl_template, sizeof(*t));
530 528
531 t->dev_dir[0].child = t->parport_dir; 529 t->dev_dir[0].child = t->parport_dir;
532 t->parport_dir[0].child = t->port_dir; 530 t->parport_dir[0].child = t->port_dir;