summaryrefslogtreecommitdiff
path: root/net/bluetooth/rfcomm/tty.c
diff options
context:
space:
mode:
authorKaike Wan <kaike.wan@intel.com>2020-03-26 12:38:14 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-04-13 10:31:33 +0200
commit2c735183134dde3c483bbab9e22e34f1e03ba696 (patch)
tree5d1d22a3dd1c69f5bb6325984f4d8d36a2985159 /net/bluetooth/rfcomm/tty.c
parentc4e0295d3bf2650312167a302b39e1f0442bf3e5 (diff)
IB/hfi1: Call kobject_put() when kobject_init_and_add() fails
commit dfb5394f804ed4fcea1fc925be275a38d66712ab 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>
Diffstat (limited to 'net/bluetooth/rfcomm/tty.c')
0 files changed, 0 insertions, 0 deletions