mbox series

[0/2] General bug fixes to amd_sfh driver

Message ID 20210512131156.740493-1-Basavaraj.Natikar@amd.com (mailing list archive)
Headers show
Series General bug fixes to amd_sfh driver | expand

Message

Basavaraj Natikar May 12, 2021, 1:11 p.m. UTC
The allocations which are required lifetime of amd_sfh driver is
changed from kzalloc with devm_kzalloc. This cleans up an exit & error
paths, since the objects does not need to be explicitly freed anymore.

amd_sfh driver with kernel memory detector config enabled. kmemleak
(/sys/kernel/debug/kmemleak): suspected memory leaks in amd_sfh driver.
So added a kfree which frees request_list entry once the processed entry
is removed from the request_list.

Basavaraj Natikar (2):
  amd_sfh: Use devm_kzalloc() instead of kzalloc()
  amd_sfh: Fix memory leak in amd_sfh_work

 drivers/hid/amd-sfh-hid/amd_sfh_client.c | 19 ++++++++++---------
 drivers/hid/amd-sfh-hid/amd_sfh_hid.c    |  3 ---
 2 files changed, 10 insertions(+), 12 deletions(-)

Comments

Jiri Kosina May 26, 2021, 10:48 a.m. UTC | #1
On Wed, 12 May 2021, Basavaraj Natikar wrote:

> The allocations which are required lifetime of amd_sfh driver is
> changed from kzalloc with devm_kzalloc. This cleans up an exit & error
> paths, since the objects does not need to be explicitly freed anymore.
> 
> amd_sfh driver with kernel memory detector config enabled. kmemleak
> (/sys/kernel/debug/kmemleak): suspected memory leaks in amd_sfh driver.
> So added a kfree which frees request_list entry once the processed entry
> is removed from the request_list.
> 
> Basavaraj Natikar (2):
>   amd_sfh: Use devm_kzalloc() instead of kzalloc()
>   amd_sfh: Fix memory leak in amd_sfh_work
> 
>  drivers/hid/amd-sfh-hid/amd_sfh_client.c | 19 ++++++++++---------
>  drivers/hid/amd-sfh-hid/amd_sfh_hid.c    |  3 ---
>  2 files changed, 10 insertions(+), 12 deletions(-)

Queued in for-5.13/upstream-fixes, thank you.