linux-rdma.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dennis Dalessandro <dennis.dalessandro@intel.com>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: dledford@redhat.com, linux-rdma@vger.kernel.org,
	Mike Marciniszyn <mike.marciniszyn@intel.com>,
	stable@vger.kernel.org, Kaike Wan <kaike.wan@intel.com>
Subject: Re: [PATCH for-rc or next 3/3] IB/qib: Call kobject_put() when kobject_init_and_add() fails
Date: Wed, 20 May 2020 09:49:48 -0400	[thread overview]
Message-ID: <1ce35d57-8b21-0379-17a1-61b9d6dc1f02@intel.com> (raw)
In-Reply-To: <20200520000055.GA6205@ziepe.ca>

On 5/19/2020 8:00 PM, Jason Gunthorpe wrote:
> On Mon, May 11, 2020 at 11:13:28PM -0400, Dennis Dalessandro wrote:
>> From: Kaike Wan <kaike.wan@intel.com>
>>
>> When kobject_init_and_add() returns an error in the function
>> qib_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. In addition, the ppd->diagc_kobj is
>> released along with other kobjects when the sysfs is unregistered.
>>
>> Fixes: f931551bafe1 ("IB/qib: Add new qib driver for QLogic PCIe InfiniBand adapters")
>> Cc: <stable@vger.kernel.org>
>> Suggested-by: Lin Yi <teroincn@gmail.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>
>> Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
>> ---
>>   drivers/infiniband/hw/qib/qib_sysfs.c |    9 +++++----
>>   1 file changed, 5 insertions(+), 4 deletions(-)
> 
> Applied to for-rc
> 
> Are you respinning the other two patches?

Yes, Kaike is working on getting updates to those two out.

-Denny


      reply	other threads:[~2020-05-20 13:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-12  3:13 [PATCH for-rc or next 0/3] minor hfi and qib fixes Dennis Dalessandro
2020-05-12  3:13 ` [PATCH for-rc or next 1/3] IB/hfi1: Do not destroy hfi1_wq when the device is shut down Dennis Dalessandro
2020-05-12  5:55   ` Leon Romanovsky
2020-05-12 11:52     ` Wan, Kaike
2020-05-13  7:58       ` Leon Romanovsky
2020-05-13 13:31         ` Wan, Kaike
2020-05-20  0:26   ` Jason Gunthorpe
2020-05-20 11:08     ` Wan, Kaike
2020-05-12  3:13 ` [PATCH for-rc or next 2/3] IB/hfi1: Do not destroy link_wq " Dennis Dalessandro
2020-05-12  5:56   ` Leon Romanovsky
2020-05-12 12:12     ` Wan, Kaike
2020-05-12  3:13 ` [PATCH for-rc or next 3/3] IB/qib: Call kobject_put() when kobject_init_and_add() fails Dennis Dalessandro
2020-05-12  6:02   ` Leon Romanovsky
2020-05-20  0:00   ` Jason Gunthorpe
2020-05-20 13:49     ` Dennis Dalessandro [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1ce35d57-8b21-0379-17a1-61b9d6dc1f02@intel.com \
    --to=dennis.dalessandro@intel.com \
    --cc=dledford@redhat.com \
    --cc=jgg@ziepe.ca \
    --cc=kaike.wan@intel.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=mike.marciniszyn@intel.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).