diff options
author | Oliver Neukum <oliver@neukum.org> | 2006-01-06 20:54:29 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-03-20 14:49:52 -0800 |
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 f82c9c9e5d5..f07d44357ff 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) return -1; } - private = kmalloc(sizeof(struct lgff_device), GFP_KERNEL); + private = kzalloc(sizeof(struct lgff_device), GFP_KERNEL); if (!private) return -1; - memset(private, 0, sizeof(struct lgff_device)); hid->ff_private = private; /* Input init */ @@ -228,13 +227,12 @@ static struct hid_report* hid_lgff_duplicate_report(struct hid_report* report) } *ret->field[0] = *report->field[0]; - ret->field[0]->value = kmalloc(sizeof(s32[8]), GFP_KERNEL); + ret->field[0]->value = kzalloc(sizeof(s32[8]), GFP_KERNEL); if (!ret->field[0]->value) { kfree(ret->field[0]); kfree(ret); return NULL; } - memset(ret->field[0]->value, 0, sizeof(s32[8])); return ret; } |