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