aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/mouse
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/mouse')
-rw-r--r--drivers/input/mouse/hil_ptr.c7
-rw-r--r--drivers/input/mouse/synaptics.c7
2 files changed, 6 insertions, 8 deletions
diff --git a/drivers/input/mouse/hil_ptr.c b/drivers/input/mouse/hil_ptr.c
index c2bf2ed07dc6..798f4a3ad7d2 100644
--- a/drivers/input/mouse/hil_ptr.c
+++ b/drivers/input/mouse/hil_ptr.c
@@ -245,10 +245,11 @@ static int hil_ptr_connect(struct serio *serio, struct serio_driver *driver)
245 unsigned int i, naxsets, btntype; 245 unsigned int i, naxsets, btntype;
246 uint8_t did, *idd; 246 uint8_t did, *idd;
247 247
248 if (!(ptr = kmalloc(sizeof(struct hil_ptr), GFP_KERNEL))) return -ENOMEM; 248 if (!(ptr = kzalloc(sizeof(struct hil_ptr), GFP_KERNEL)))
249 memset(ptr, 0, sizeof(struct hil_ptr)); 249 return -ENOMEM;
250 250
251 if (serio_open(serio, driver)) goto bail0; 251 if (serio_open(serio, driver))
252 goto bail0;
252 253
253 serio_set_drvdata(serio, ptr); 254 serio_set_drvdata(serio, ptr);
254 ptr->serio = serio; 255 ptr->serio = serio;
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 2051bec2c394..d27d52c3c656 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -247,14 +247,12 @@ static void synaptics_pt_create(struct psmouse *psmouse)
247{ 247{
248 struct serio *serio; 248 struct serio *serio;
249 249
250 serio = kmalloc(sizeof(struct serio), GFP_KERNEL); 250 serio = kzalloc(sizeof(struct serio), GFP_KERNEL);
251 if (!serio) { 251 if (!serio) {
252 printk(KERN_ERR "synaptics: not enough memory to allocate pass-through port\n"); 252 printk(KERN_ERR "synaptics: not enough memory to allocate pass-through port\n");
253 return; 253 return;
254 } 254 }
255 255
256 memset(serio, 0, sizeof(struct serio));
257
258 serio->id.type = SERIO_PS_PSTHRU; 256 serio->id.type = SERIO_PS_PSTHRU;
259 strlcpy(serio->name, "Synaptics pass-through", sizeof(serio->name)); 257 strlcpy(serio->name, "Synaptics pass-through", sizeof(serio->name));
260 strlcpy(serio->phys, "synaptics-pt/serio0", sizeof(serio->name)); 258 strlcpy(serio->phys, "synaptics-pt/serio0", sizeof(serio->name));
@@ -623,10 +621,9 @@ int synaptics_init(struct psmouse *psmouse)
623{ 621{
624 struct synaptics_data *priv; 622 struct synaptics_data *priv;
625 623
626 psmouse->private = priv = kmalloc(sizeof(struct synaptics_data), GFP_KERNEL); 624 psmouse->private = priv = kzalloc(sizeof(struct synaptics_data), GFP_KERNEL);
627 if (!priv) 625 if (!priv)
628 return -1; 626 return -1;
629 memset(priv, 0, sizeof(struct synaptics_data));
630 627
631 if (synaptics_query_hardware(psmouse)) { 628 if (synaptics_query_hardware(psmouse)) {
632 printk(KERN_ERR "Unable to query Synaptics hardware.\n"); 629 printk(KERN_ERR "Unable to query Synaptics hardware.\n");