diff options
| author | Akinobu Mita <[email protected]> | 2018-10-20 10:26:23 -0400 |
|---|---|---|
| committer | Mauro Carvalho Chehab <[email protected]> | 2018-11-23 04:33:36 -0500 |
| commit | c764da98a600a4b068d25c77164f092f159cecec (patch) | |
| tree | dc17c3d32b15dfa065b40880fd125f24d5e23ec2 /tools/perf/scripts/python/export-to-sqlite.py | |
| parent | 8e782fcf78275f505194e767c515202d4fd274bc (diff) | |
media: video-i2c: avoid accessing released memory area when removing driver
The video device release() callback for video-i2c driver frees the whole
struct video_i2c_data. If there is no user left for the video device
when video_unregister_device() is called, the release callback is executed.
However, in video_i2c_remove() some fields (v4l2_dev, lock, and queue_lock)
in struct video_i2c_data are still accessed after video_unregister_device()
is called.
This fixes the use after free by moving the code from video_i2c_remove()
to the release() callback.
Fixes: 5cebaac60974 ("media: video-i2c: add video-i2c driver")
Reviewed-by: Matt Ranostay <[email protected]>
Signed-off-by: Akinobu Mita <[email protected]>
Acked-by: Sakari Ailus <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions