mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: Zhu Wang <wangzhu9@huawei.com>
Cc: <kartilak@cisco.com>, <sebaddel@cisco.com>, <jejb@linux.ibm.com>,
	<martin.petersen@oracle.com>, <nmusini@cisco.com>,
	<bvanassche@acm.org>, <dan.carpenter@linaro.org>,
	<linux-scsi@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH -next] scsi: snic: fix double free in snic_tgt_create()
Date: Thu, 24 Aug 2023 22:03:08 -0400	[thread overview]
Message-ID: <yq1ttsn3mnz.fsf@ca-mkp.ca.oracle.com> (raw)
In-Reply-To: <20230819083941.164365-1-wangzhu9@huawei.com> (Zhu Wang's message of "Sat, 19 Aug 2023 08:39:41 +0000")


Zhu,

> The commit 41320b18a0e0 ("scsi: snic: Fix possible memory leak if
> device_add() fails") fix the memory leak caused by dev_set_name() when
> device_add() failed. While it did not consider that 'tgt' has already
> been released when put_device(&tgt->dev) is called. We removed
> kfree(tgt) in the error path to avoid double free 'tgt'.

Where is tgt freed prior to the kfree() call?

-- 
Martin K. Petersen	Oracle Linux Engineering

  reply	other threads:[~2023-08-25  2:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-19  8:39 Zhu Wang
2023-08-25  2:03 ` Martin K. Petersen [this message]
     [not found]   ` <54e80365-21c4-47ed-8b38-8cead6271163@huawei.com>
2023-08-25  2:32     ` Martin K. Petersen
2023-08-25 21:50 ` Martin K. Petersen

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=yq1ttsn3mnz.fsf@ca-mkp.ca.oracle.com \
    --to=martin.petersen@oracle.com \
    --cc=bvanassche@acm.org \
    --cc=dan.carpenter@linaro.org \
    --cc=jejb@linux.ibm.com \
    --cc=kartilak@cisco.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=nmusini@cisco.com \
    --cc=sebaddel@cisco.com \
    --cc=wangzhu9@huawei.com \
    /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

all inboxes | Powered by JetHome®