[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <yq1ttsn3mnz.fsf@ca-mkp.ca.oracle.com>
Date: Thu, 24 Aug 2023 22:03:08 -0400
From: "Martin K. Petersen" <martin.petersen@...cle.com>
To: Zhu Wang <wangzhu9@...wei.com>
Cc: <kartilak@...co.com>, <sebaddel@...co.com>, <jejb@...ux.ibm.com>,
<martin.petersen@...cle.com>, <nmusini@...co.com>,
<bvanassche@....org>, <dan.carpenter@...aro.org>,
<linux-scsi@...r.kernel.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -next] scsi: snic: fix double free in snic_tgt_create()
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
Powered by blists - more mailing lists