Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

HID: appleir: Use devm_kzalloc() instead of kzalloc()

Signed-off-by: Lucas Tanure <tanure@linux.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>

authored by

Lucas Tanure and committed by
Jiri Kosina
910a7e89 b08e8d8a

+2 -3
+2 -3
drivers/hid/hid-appleir.c
··· 283 283 int ret; 284 284 struct appleir *appleir; 285 285 286 - appleir = kzalloc(sizeof(struct appleir), GFP_KERNEL); 286 + appleir = devm_kzalloc(&hid->dev, sizeof(struct appleir), GFP_KERNEL); 287 287 if (!appleir) 288 288 return -ENOMEM; 289 289 ··· 311 311 312 312 return 0; 313 313 fail: 314 - kfree(appleir); 314 + devm_kfree(&hid->dev, appleir); 315 315 return ret; 316 316 } 317 317 ··· 320 320 struct appleir *appleir = hid_get_drvdata(hid); 321 321 hid_hw_stop(hid); 322 322 del_timer_sync(&appleir->key_up_timer); 323 - kfree(appleir); 324 323 } 325 324 326 325 static const struct hid_device_id appleir_devices[] = {