Re: [PATCH 1/5] media: video-i2c: avoid accessing released memory area when removing driver

2018-09-19 Thread Akinobu Mita
2018年9月19日(水) 19:35 Sakari Ailus : > > Hi Mita-san, > > On Tue, Sep 18, 2018 at 01:03:07AM +0900, Akinobu Mita wrote: > > The struct video_i2c_data is released when video_unregister_device() is > > called, but it will still be accessed after calling > > video_unregister_device(). > > > > Use

Re: [PATCH 1/5] media: video-i2c: avoid accessing released memory area when removing driver

2018-09-19 Thread Sakari Ailus
Hi Mita-san, On Tue, Sep 18, 2018 at 01:03:07AM +0900, Akinobu Mita wrote: > The struct video_i2c_data is released when video_unregister_device() is > called, but it will still be accessed after calling > video_unregister_device(). > > Use devm_kzalloc() and let the memory be automatically

Re: [PATCH 1/5] media: video-i2c: avoid accessing released memory area when removing driver

2018-09-17 Thread Matt Ranostay
On Mon, Sep 17, 2018 at 9:03 AM Akinobu Mita wrote: > > The struct video_i2c_data is released when video_unregister_device() is > called, but it will still be accessed after calling > video_unregister_device(). > > Use devm_kzalloc() and let the memory be automatically released on driver >

[PATCH 1/5] media: video-i2c: avoid accessing released memory area when removing driver

2018-09-17 Thread Akinobu Mita
The struct video_i2c_data is released when video_unregister_device() is called, but it will still be accessed after calling video_unregister_device(). Use devm_kzalloc() and let the memory be automatically released on driver detach. Fixes: 5cebaac60974 ("media: video-i2c: add video-i2c driver")