aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/joydev.c
diff options
context:
space:
mode:
authorEric Sesterhenn <snakebyte@gmx.de>2006-03-14 00:09:16 -0500
committerDmitry Torokhov <dtor_core@ameritech.net>2006-03-14 00:09:16 -0500
commitb39787a972042ded183343b177d9c595b5704575 (patch)
treeff0336c45ff4f8bbb3e64af5cc16bcfe75fbb54b /drivers/input/joydev.c
parent493a7e0d5614c30e1f3e56d59ab774300a2609f2 (diff)
Input: use kzalloc() throughout the code
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/joydev.c')
-rw-r--r--drivers/input/joydev.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c
index 20e2972b9204..949bdcef8c2b 100644
--- a/drivers/input/joydev.c
+++ b/drivers/input/joydev.c
@@ -171,9 +171,8 @@ static int joydev_open(struct inode *inode, struct file *file)
171 if (i >= JOYDEV_MINORS || !joydev_table[i]) 171 if (i >= JOYDEV_MINORS || !joydev_table[i])
172 return -ENODEV; 172 return -ENODEV;
173 173
174 if (!(list = kmalloc(sizeof(struct joydev_list), GFP_KERNEL))) 174 if (!(list = kzalloc(sizeof(struct joydev_list), GFP_KERNEL)))
175 return -ENOMEM; 175 return -ENOMEM;
176 memset(list, 0, sizeof(struct joydev_list));
177 176
178 list->joydev = joydev_table[i]; 177 list->joydev = joydev_table[i];
179 list_add_tail(&list->node, &joydev_table[i]->list); 178 list_add_tail(&list->node, &joydev_table[i]->list);
@@ -457,9 +456,8 @@ static struct input_handle *joydev_connect(struct input_handler *handler, struct
457 return NULL; 456 return NULL;
458 } 457 }
459 458
460 if (!(joydev = kmalloc(sizeof(struct joydev), GFP_KERNEL))) 459 if (!(joydev = kzalloc(sizeof(struct joydev), GFP_KERNEL)))
461 return NULL; 460 return NULL;
462 memset(joydev, 0, sizeof(struct joydev));
463 461
464 INIT_LIST_HEAD(&joydev->list); 462 INIT_LIST_HEAD(&joydev->list);
465 init_waitqueue_head(&joydev->wait); 463 init_waitqueue_head(&joydev->wait);