Input: use kzalloc() throughout the code
Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This commit is contained in:
committed by
Dmitry Torokhov
parent
493a7e0d56
commit
b39787a972
@ -412,9 +412,8 @@ static int mousedev_open(struct inode * inode, struct file * file)
|
||||
if (i >= MOUSEDEV_MINORS || !mousedev_table[i])
|
||||
return -ENODEV;
|
||||
|
||||
if (!(list = kmalloc(sizeof(struct mousedev_list), GFP_KERNEL)))
|
||||
if (!(list = kzalloc(sizeof(struct mousedev_list), GFP_KERNEL)))
|
||||
return -ENOMEM;
|
||||
memset(list, 0, sizeof(struct mousedev_list));
|
||||
|
||||
spin_lock_init(&list->packet_lock);
|
||||
list->pos_x = xres / 2;
|
||||
@ -626,9 +625,8 @@ static struct input_handle *mousedev_connect(struct input_handler *handler, stru
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!(mousedev = kmalloc(sizeof(struct mousedev), GFP_KERNEL)))
|
||||
if (!(mousedev = kzalloc(sizeof(struct mousedev), GFP_KERNEL)))
|
||||
return NULL;
|
||||
memset(mousedev, 0, sizeof(struct mousedev));
|
||||
|
||||
INIT_LIST_HEAD(&mousedev->list);
|
||||
init_waitqueue_head(&mousedev->wait);
|
||||
|
Reference in New Issue
Block a user