diff options
Diffstat (limited to 'drivers/usb/input/hiddev.c')
| -rw-r--r-- | drivers/usb/input/hiddev.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/usb/input/hiddev.c b/drivers/usb/input/hiddev.c index 925f5aba06f5..6dd666696178 100644 --- a/drivers/usb/input/hiddev.c +++ b/drivers/usb/input/hiddev.c | |||
| @@ -257,9 +257,8 @@ static int hiddev_open(struct inode * inode, struct file * file) { | |||
| 257 | if (i >= HIDDEV_MINORS || !hiddev_table[i]) | 257 | if (i >= HIDDEV_MINORS || !hiddev_table[i]) |
| 258 | return -ENODEV; | 258 | return -ENODEV; |
| 259 | 259 | ||
| 260 | if (!(list = kmalloc(sizeof(struct hiddev_list), GFP_KERNEL))) | 260 | if (!(list = kzalloc(sizeof(struct hiddev_list), GFP_KERNEL))) |
| 261 | return -ENOMEM; | 261 | return -ENOMEM; |
| 262 | memset(list, 0, sizeof(struct hiddev_list)); | ||
| 263 | 262 | ||
| 264 | list->hiddev = hiddev_table[i]; | 263 | list->hiddev = hiddev_table[i]; |
| 265 | list->next = hiddev_table[i]->list; | 264 | list->next = hiddev_table[i]->list; |
| @@ -754,9 +753,8 @@ int hiddev_connect(struct hid_device *hid) | |||
| 754 | if (i == hid->maxcollection && (hid->quirks & HID_QUIRK_HIDDEV) == 0) | 753 | if (i == hid->maxcollection && (hid->quirks & HID_QUIRK_HIDDEV) == 0) |
| 755 | return -1; | 754 | return -1; |
| 756 | 755 | ||
| 757 | if (!(hiddev = kmalloc(sizeof(struct hiddev), GFP_KERNEL))) | 756 | if (!(hiddev = kzalloc(sizeof(struct hiddev), GFP_KERNEL))) |
| 758 | return -1; | 757 | return -1; |
| 759 | memset(hiddev, 0, sizeof(struct hiddev)); | ||
| 760 | 758 | ||
| 761 | retval = usb_register_dev(hid->intf, &hiddev_class); | 759 | retval = usb_register_dev(hid->intf, &hiddev_class); |
| 762 | if (retval) { | 760 | if (retval) { |
