HID: egalax: Use kzalloc
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>
This commit is contained in:
committed by
Jiri Kosina
parent
587d145200
commit
5a39ce5b49
@@ -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;
|
||||
|
Reference in New Issue
Block a user