diff options
author | Oliver Neukum <oliver@neukum.org> | 2006-01-06 14:54:29 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-03-20 17:49:52 -0500 |
commit | bbdb7dafb5b5a3c0197cbabd5055d8e9c093e3ea (patch) | |
tree | 9ac23c97ef6a983e4e7a98e19f9307b8d3aad1f4 /drivers/usb/input/hid-lgff.c | |
parent | 887c2560b6ceb5fe7ac24704e85af507c6d960e5 (diff) |
[PATCH] USB: kzalloc for hid
this uses kzalloc in hid.
Signed-off-by: Oliver Neukum <oliver@neukum.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
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 | } |