From: Bart Van Assche <bart.vanassche@sandisk.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: James Bottomley <james.bottomley@hansenpartnership.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Hannes Reinecke <hare@suse.de>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
linux-kernel@vger.kernel.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH] Fix a memory leak in scsi_host_dev_release()
Date: Fri, 20 Nov 2015 09:49:42 -0800 [thread overview]
Message-ID: <564F5D36.8010402@sandisk.com> (raw)
In-Reply-To: <20151120115212.GA23875@infradead.org>
On 11/20/2015 03:52 AM, Christoph Hellwig wrote:
> the memory leak looks real, and your fix looks corret, but I still
> don't like it.
>
> I think it's reasonable for SCSI to assume that the final put_device
> fully frees the struct device including the name pointer that is
> assigned entirely behind the back of the caller.
>
> So I think the fix for this probably should be in the driver core.
Hello Christoph,
Thanks for the feedback. However, I'm not sure this can be fixed by
modifying the driver core. If scsi_host_remove() is not called the SCSI
core doesn't call put_device(&shost->shost_dev). I will post a second
version of this patch that ensures that the SCSI core always calls
put_device(&shost->shost_dev).
Bart.
WARNING: multiple messages have this Message-ID (diff)
From: Bart Van Assche <bart.vanassche@sandisk.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: James Bottomley <james.bottomley@hansenpartnership.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
Hannes Reinecke <hare@suse.de>,
"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Subject: Re: [PATCH] Fix a memory leak in scsi_host_dev_release()
Date: Fri, 20 Nov 2015 09:49:42 -0800 [thread overview]
Message-ID: <564F5D36.8010402@sandisk.com> (raw)
In-Reply-To: <20151120115212.GA23875@infradead.org>
On 11/20/2015 03:52 AM, Christoph Hellwig wrote:
> the memory leak looks real, and your fix looks corret, but I still
> don't like it.
>
> I think it's reasonable for SCSI to assume that the final put_device
> fully frees the struct device including the name pointer that is
> assigned entirely behind the back of the caller.
>
> So I think the fix for this probably should be in the driver core.
Hello Christoph,
Thanks for the feedback. However, I'm not sure this can be fixed by
modifying the driver core. If scsi_host_remove() is not called the SCSI
core doesn't call put_device(&shost->shost_dev). I will post a second
version of this patch that ensures that the SCSI core always calls
put_device(&shost->shost_dev).
Bart.
next prev parent reply other threads:[~2015-11-20 17:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-18 22:56 [PATCH] Fix a memory leak in scsi_host_dev_release() Bart Van Assche
2015-11-20 11:52 ` Christoph Hellwig
2015-11-20 17:49 ` Bart Van Assche [this message]
2015-11-20 17:49 ` Bart Van Assche
2015-11-22 15:08 ` Christoph Hellwig
2015-11-24 12:55 ` Johannes Thumshirn
2015-11-24 14:50 ` Sagi Grimberg
2015-11-24 23:10 ` Lee Duncan
2015-12-01 1:46 ` 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=564F5D36.8010402@sandisk.com \
--to=bart.vanassche@sandisk.com \
--cc=gregkh@linuxfoundation.org \
--cc=hare@suse.de \
--cc=hch@infradead.org \
--cc=james.bottomley@hansenpartnership.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.