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

Configure Feed

Select the types of activity you want to include in your feed.

Input: ili210x - use kvmalloc() to allocate buffer for firmware update

Allocating a contiguous buffer of 64K may fail if memory is sufficiently
fragmented, and may cause OOM kill of an unrelated process. However we
do not need to have contiguous memory. We also do not need to zero
out the buffer since it will be overwritten with firmware data.

Switch to using kvmalloc() instead of kzalloc().

Link: https://lore.kernel.org/r/20240609234757.610273-1-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

+3 -3
+3 -3
drivers/input/touchscreen/ili210x.c
··· 597 597 * once, copy them all into this buffer at the right locations, and then 598 598 * do all operations on this linear buffer. 599 599 */ 600 - fw_buf = kzalloc(SZ_64K, GFP_KERNEL); 600 + fw_buf = kvmalloc(SZ_64K, GFP_KERNEL); 601 601 if (!fw_buf) 602 602 return -ENOMEM; 603 603 ··· 627 627 return 0; 628 628 629 629 err_big: 630 - kfree(fw_buf); 630 + kvfree(fw_buf); 631 631 return error; 632 632 } 633 633 ··· 870 870 ili210x_hardware_reset(priv->reset_gpio); 871 871 dev_dbg(dev, "Firmware update ended, error=%i\n", error); 872 872 enable_irq(client->irq); 873 - kfree(fwbuf); 873 + kvfree(fwbuf); 874 874 return error; 875 875 } 876 876