aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/fpga/machxo2-spi.c
diff options
context:
space:
mode:
authorKaike Wan <[email protected]>2020-03-26 16:38:14 +0000
committerJason Gunthorpe <[email protected]>2020-03-27 16:13:36 +0000
commitdfb5394f804ed4fcea1fc925be275a38d66712ab (patch)
tree65d182d7cfb6539406444c0aedd725321ca6c5f1 /drivers/fpga/machxo2-spi.c
parentIB/hfi1: Fix memory leaks in sysfs registration and unregistration (diff)
downloadkernel-dfb5394f804ed4fcea1fc925be275a38d66712ab.tar.gz
kernel-dfb5394f804ed4fcea1fc925be275a38d66712ab.zip
IB/hfi1: Call kobject_put() when kobject_init_and_add() fails
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: <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Mike Marciniszyn <[email protected]> Signed-off-by: Kaike Wan <[email protected]> Signed-off-by: Dennis Dalessandro <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
Diffstat (limited to 'drivers/fpga/machxo2-spi.c')
0 files changed, 0 insertions, 0 deletions