]> git.baikalelectronics.ru Git - kernel.git/commit
HID: alps: Save a memory allocation in 't4_read_write_register()' when writing data
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Mon, 19 Mar 2018 20:53:27 +0000 (21:53 +0100)
committerJiri Kosina <jkosina@suse.cz>
Thu, 26 Apr 2018 12:33:35 +0000 (14:33 +0200)
commit53be722ae19ab002d112fd61413aaa1d818f77e0
treec1c10619a7ca56a487ae360e704eb95729d6cc71
parentc00acdcc113d0a21ecbadf0bcb8b6b9e4791f618
HID: alps: Save a memory allocation in 't4_read_write_register()' when writing data

if 'read_flag' is false, there is no need to allocate and free memory.
We can simply avoid the memory allocation and pass NULL to kfree.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-alps.c