HID: egalax: Use kzalloc
authorHenrik Rydberg <rydberg@euromail.se>
Wed, 13 Oct 2010 13:58:17 +0000 (15:58 +0200)
committerJiri Kosina <jkosina@suse.cz>
Thu, 4 Nov 2010 15:04:44 +0000 (11:04 -0400)
To avoid unnecessary explicit initialization, allocate zeroed memory.

Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Acked-by: Chase Douglas <chase.douglas@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-egalax.c

index 54b017a..5a1b52e 100644 (file)
@@ -221,7 +221,7 @@ static int egalax_probe(struct hid_device *hdev, const struct hid_device_id *id)
        struct egalax_data *td;
        struct hid_report *report;
 
-       td = kmalloc(sizeof(struct egalax_data), GFP_KERNEL);
+       td = kzalloc(sizeof(struct egalax_data), GFP_KERNEL);
        if (!td) {
                dev_err(&hdev->dev, "cannot allocate eGalax data\n");
                return -ENOMEM;