Re: [PATCH 2/2] virtio: don't free memory until the underlying struct device has been released

2015-01-04 Thread Michael S. Tsirkin
On Sun, Jan 04, 2015 at 10:03:27AM -0500, Sasha Levin wrote: > On 01/04/2015 06:26 AM, Michael S. Tsirkin wrote: > > On Fri, Jan 02, 2015 at 02:47:40PM -0500, Sasha Levin wrote: > >> > When releasing a virtio device, We can't free a struct virtio_device > >> > until the > >> > underlying struct

Re: [PATCH 2/2] virtio: don't free memory until the underlying struct device has been released

2015-01-04 Thread Sasha Levin
On 01/04/2015 06:26 AM, Michael S. Tsirkin wrote: > On Fri, Jan 02, 2015 at 02:47:40PM -0500, Sasha Levin wrote: >> > When releasing a virtio device, We can't free a struct virtio_device until >> > the >> > underlying struct device has been released, which might not happen >> > immediately >> >

Re: [PATCH 2/2] virtio: don't free memory until the underlying struct device has been released

2015-01-04 Thread Michael S. Tsirkin
On Fri, Jan 02, 2015 at 02:47:40PM -0500, Sasha Levin wrote: > When releasing a virtio device, We can't free a struct virtio_device until the > underlying struct device has been released, which might not happen immediately > on device_unregister() even if that was the device's last reference. > >

Re: [PATCH 2/2] virtio: don't free memory until the underlying struct device has been released

2015-01-04 Thread Michael S. Tsirkin
On Fri, Jan 02, 2015 at 02:47:40PM -0500, Sasha Levin wrote: When releasing a virtio device, We can't free a struct virtio_device until the underlying struct device has been released, which might not happen immediately on device_unregister() even if that was the device's last reference.

Re: [PATCH 2/2] virtio: don't free memory until the underlying struct device has been released

2015-01-04 Thread Sasha Levin
On 01/04/2015 06:26 AM, Michael S. Tsirkin wrote: On Fri, Jan 02, 2015 at 02:47:40PM -0500, Sasha Levin wrote: When releasing a virtio device, We can't free a struct virtio_device until the underlying struct device has been released, which might not happen immediately on

Re: [PATCH 2/2] virtio: don't free memory until the underlying struct device has been released

2015-01-04 Thread Michael S. Tsirkin
On Sun, Jan 04, 2015 at 10:03:27AM -0500, Sasha Levin wrote: On 01/04/2015 06:26 AM, Michael S. Tsirkin wrote: On Fri, Jan 02, 2015 at 02:47:40PM -0500, Sasha Levin wrote: When releasing a virtio device, We can't free a struct virtio_device until the underlying struct device has been

[PATCH 2/2] virtio: don't free memory until the underlying struct device has been released

2015-01-02 Thread Sasha Levin
When releasing a virtio device, We can't free a struct virtio_device until the underlying struct device has been released, which might not happen immediately on device_unregister() even if that was the device's last reference. Instead, free the memory only once we know the device is gone in the

[PATCH 2/2] virtio: don't free memory until the underlying struct device has been released

2015-01-02 Thread Sasha Levin
When releasing a virtio device, We can't free a struct virtio_device until the underlying struct device has been released, which might not happen immediately on device_unregister() even if that was the device's last reference. Instead, free the memory only once we know the device is gone in the