Re: [PATCH for-rc 2/2] IB/hfi1: Call kobject_put() when kobject_init_and_add() fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 3/26/2020 12:38 PM, Dennis Dalessandro wrote:
From: Kaike Wan <kaike.wan@xxxxxxxxx>

When kobject_init_and_add() returns an error in the function
hfi1_create_port_files(), the function kobject_put() is not called for
the corresponding kobject, which potentially leads to memory leak.

This patch fixes the issue by calling kobject_put() even if
kobject_init_and_add() fails.

Cc: <stable@xxxxxxxxxxxxxxx>
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@xxxxxxxxx>
Signed-off-by: Kaike Wan <kaike.wan@xxxxxxxxx>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@xxxxxxxxx>

My bad, overzealous commit message clean up on my part, lost this:

Fixes: 7724105686e7 ("IB/hfi1: add driver files")

-Denny



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux