Files
linux/drivers
Kaike Wan 8e2335d854 IB/hfi1: Call kobject_put() when kobject_init_and_add() fails
commit dfb5394f80 upstream.

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@vger.kernel.org>
Link: https://lore.kernel.org/r/20200326163813.21129.44280.stgit@awfm-01.aw.intel.com
Reviewed-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
Signed-off-by: Kaike Wan <kaike.wan@intel.com>
Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-04-13 10:45:11 +02:00
..
2020-03-25 08:06:13 +01:00
2020-04-13 10:45:10 +02:00
2020-02-24 08:34:44 +01:00
2020-03-11 14:14:45 +01:00
2020-04-13 10:45:03 +02:00
2020-03-20 11:55:59 +01:00
2020-04-13 10:45:03 +02:00
2020-02-24 08:34:47 +01:00