|
@@ -476,10 +476,9 @@ int parport_proc_register(struct parport *port)
|
|
|
struct parport_sysctl_table *t;
|
|
|
int i;
|
|
|
|
|
|
- t = kmalloc(sizeof(*t), GFP_KERNEL);
|
|
|
+ t = kmemdup(&parport_sysctl_template, sizeof(*t), GFP_KERNEL);
|
|
|
if (t == NULL)
|
|
|
return -ENOMEM;
|
|
|
- memcpy(t, &parport_sysctl_template, sizeof(*t));
|
|
|
|
|
|
t->device_dir[0].extra1 = port;
|
|
|
|
|
@@ -523,10 +522,9 @@ int parport_device_proc_register(struct pardevice *device)
|
|
|
struct parport_device_sysctl_table *t;
|
|
|
struct parport * port = device->port;
|
|
|
|
|
|
- t = kmalloc(sizeof(*t), GFP_KERNEL);
|
|
|
+ t = kmemdup(&parport_device_sysctl_template, sizeof(*t), GFP_KERNEL);
|
|
|
if (t == NULL)
|
|
|
return -ENOMEM;
|
|
|
- memcpy(t, &parport_device_sysctl_template, sizeof(*t));
|
|
|
|
|
|
t->dev_dir[0].child = t->parport_dir;
|
|
|
t->parport_dir[0].child = t->port_dir;
|