diff options
| author | Laurent Pinchart <[email protected]> | 2020-08-11 22:59:39 +0200 |
|---|---|---|
| committer | Mauro Carvalho Chehab <[email protected]> | 2020-09-10 14:27:46 +0200 |
| commit | 86d37bf31af647760f1f17e7c1afa1bdba075198 (patch) | |
| tree | 8392ebbc5c5eb672db5c5c248f95433a6ab0b028 /tools/perf/scripts/python | |
| parent | 2cac7cbfb4099980e78244359ab9c6f056d6a7ec (diff) | |
media: i2c: max9286: Allocate v4l2_async_subdev dynamically
v4l2_async_notifier_add_subdev() requires the asd to be allocated
dynamically, but the max9286 driver embeds it in the max9286_source
structure. This causes memory corruption when the notifier is destroyed
at remove time with v4l2_async_notifier_cleanup().
Fix this issue by registering the asd with
v4l2_async_notifier_add_fwnode_subdev(), which allocates it dynamically
internally. A new max9286_asd structure is introduced, to store a
pointer to the corresonding max9286_source that needs to be accessed
from bound and unbind callbacks. There's no need to take an extra
explicit reference to the fwnode anymore as
v4l2_async_notifier_add_fwnode_subdev() does so internally.
While at it, use %u instead of %d to print the unsigned index in the
error message from the v4l2_async_notifier_add_fwnode_subdev() error
path.
Fixes: 66d8c9d2422d ("media: i2c: Add MAX9286 driver")
Signed-off-by: Laurent Pinchart <[email protected]>
Signed-off-by: Sakari Ailus <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions