diff options
Diffstat (limited to 'drivers/usb/input/hid-lgff.c')
-rw-r--r-- | drivers/usb/input/hid-lgff.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/usb/input/hid-lgff.c b/drivers/usb/input/hid-lgff.c index f82c9c9e5d51..f07d44357ff1 100644 --- a/drivers/usb/input/hid-lgff.c +++ b/drivers/usb/input/hid-lgff.c | |||
@@ -154,10 +154,9 @@ int hid_lgff_init(struct hid_device* hid) | |||
154 | return -1; | 154 | return -1; |
155 | } | 155 | } |
156 | 156 | ||
157 | private = kmalloc(sizeof(struct lgff_device), GFP_KERNEL); | 157 | private = kzalloc(sizeof(struct lgff_device), GFP_KERNEL); |
158 | if (!private) | 158 | if (!private) |
159 | return -1; | 159 | return -1; |
160 | memset(private, 0, sizeof(struct lgff_device)); | ||
161 | hid->ff_private = private; | 160 | hid->ff_private = private; |
162 | 161 | ||
163 | /* Input init */ | 162 | /* Input init */ |
@@ -228,13 +227,12 @@ static struct hid_report* hid_lgff_duplicate_report(struct hid_report* report) | |||
228 | } | 227 | } |
229 | *ret->field[0] = *report->field[0]; | 228 | *ret->field[0] = *report->field[0]; |
230 | 229 | ||
231 | ret->field[0]->value = kmalloc(sizeof(s32[8]), GFP_KERNEL); | 230 | ret->field[0]->value = kzalloc(sizeof(s32[8]), GFP_KERNEL); |
232 | if (!ret->field[0]->value) { | 231 | if (!ret->field[0]->value) { |
233 | kfree(ret->field[0]); | 232 | kfree(ret->field[0]); |
234 | kfree(ret); | 233 | kfree(ret); |
235 | return NULL; | 234 | return NULL; |
236 | } | 235 | } |
237 | memset(ret->field[0]->value, 0, sizeof(s32[8])); | ||
238 | 236 | ||
239 | return ret; | 237 | return ret; |
240 | } | 238 | } |