Re: [PATCH v3 1/3] msi: free msi_desc entry only after we've released the kobject

2013-11-26 Thread Neil Horman
On Mon, Nov 25, 2013 at 03:29:36PM -0800, Greg Kroah-Hartman wrote: > On Mon, Nov 25, 2013 at 04:12:48PM -0700, Bjorn Helgaas wrote: > > On Tue, Oct 29, 2013 at 11:30:30AM +0100, Veaceslav Falico wrote: > > > Currently, we first do kobject_put(&entry->kobj) and the kfree(entry), > > > however kobje

Re: [PATCH v3 1/3] msi: free msi_desc entry only after we've released the kobject

2013-11-25 Thread Greg Kroah-Hartman
On Mon, Nov 25, 2013 at 04:12:48PM -0700, Bjorn Helgaas wrote: > On Tue, Oct 29, 2013 at 11:30:30AM +0100, Veaceslav Falico wrote: > > Currently, we first do kobject_put(&entry->kobj) and the kfree(entry), > > however kobject_put() doesn't guarantee us that it was the last reference > > and that th

Re: [PATCH v3 1/3] msi: free msi_desc entry only after we've released the kobject

2013-11-25 Thread Bjorn Helgaas
On Tue, Oct 29, 2013 at 11:30:30AM +0100, Veaceslav Falico wrote: > Currently, we first do kobject_put(&entry->kobj) and the kfree(entry), > however kobject_put() doesn't guarantee us that it was the last reference > and that the kobj isn't used currently by someone else, so after we > kfree(entry)

Re: [PATCH v3 1/3] msi: free msi_desc entry only after we've released the kobject

2013-10-29 Thread Greg Kroah-Hartman
On Tue, Oct 29, 2013 at 09:34:28AM -0700, Linus Torvalds wrote: > On Tue, Oct 29, 2013 at 3:30 AM, Veaceslav Falico wrote: > > /* > > * Its possible that we get into this path > > * When populate_msi_sysfs fails, which means the entries > >

Re: [PATCH v3 1/3] msi: free msi_desc entry only after we've released the kobject

2013-10-29 Thread Veaceslav Falico
On Tue, Oct 29, 2013 at 09:34:28AM -0700, Linus Torvalds wrote: On Tue, Oct 29, 2013 at 3:30 AM, Veaceslav Falico wrote: /* * Its possible that we get into this path * When populate_msi_sysfs fails, which means the entries * wer

Re: [PATCH v3 1/3] msi: free msi_desc entry only after we've released the kobject

2013-10-29 Thread Linus Torvalds
On Tue, Oct 29, 2013 at 3:30 AM, Veaceslav Falico wrote: > /* > * Its possible that we get into this path > * When populate_msi_sysfs fails, which means the entries > * were not registered with sysfs. In that case don't > -

Re: [PATCH v3 1/3] msi: free msi_desc entry only after we've released the kobject

2013-10-29 Thread Neil Horman
On Tue, Oct 29, 2013 at 11:30:30AM +0100, Veaceslav Falico wrote: > Currently, we first do kobject_put(&entry->kobj) and the kfree(entry), > however kobject_put() doesn't guarantee us that it was the last reference > and that the kobj isn't used currently by someone else, so after we > kfree(entry)

[PATCH v3 1/3] msi: free msi_desc entry only after we've released the kobject

2013-10-29 Thread Veaceslav Falico
Currently, we first do kobject_put(&entry->kobj) and the kfree(entry), however kobject_put() doesn't guarantee us that it was the last reference and that the kobj isn't used currently by someone else, so after we kfree(entry) with the struct kobject - other users will begin using the freed memory,