Re: [PATCH] driver core : Fix use after free of dev->parent in device_shutdown

2013-09-24 Thread Benson Leung
On Tue, Sep 24, 2013 at 6:14 PM, Ming Lei wrote: > It is better to save one line by below: > > parent = get_device(dev->parent); > Done. > > Reviewed-by: Ming Lei Thank you! -- Benson Leung Software Engineer, Chrom* OS ble...@chromium.org -- To unsubscribe from this list:

Re: [PATCH] driver core : Fix use after free of dev->parent in device_shutdown

2013-09-24 Thread Ming Lei
On Wed, Sep 25, 2013 at 5:39 AM, Benson Leung wrote: > The put_device(dev) at the bottom of the loop of device_shutdown > may result in the dev being cleaned up. In device_create_release, > the dev is kfreed. > > However, device_shutdown attempts to use the dev pointer again after > put_device by

Re: [PATCH] driver core : Fix use after free of dev->parent in device_shutdown

2013-09-24 Thread Greg KH
On Tue, Sep 24, 2013 at 02:39:08PM -0700, Benson Leung wrote: > The put_device(dev) at the bottom of the loop of device_shutdown > may result in the dev being cleaned up. In device_create_release, > the dev is kfreed. > > However, device_shutdown attempts to use the dev pointer again after > put_d

[PATCH] driver core : Fix use after free of dev->parent in device_shutdown

2013-09-24 Thread Benson Leung
The put_device(dev) at the bottom of the loop of device_shutdown may result in the dev being cleaned up. In device_create_release, the dev is kfreed. However, device_shutdown attempts to use the dev pointer again after put_device by referring to dev->parent. Copy the parent pointer instead to avo