mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 05:55:44 +02:00
media: ti-vpe: cal: fix write to unallocated memory
[ Upstream commit5a402af5e1] The asd allocated with v4l2_async_notifier_add_fwnode_subdev() must be of size cal_v4l2_async_subdev, otherwise access to cal_v4l2_async_subdev->phy will go to unallocated memory. Fixes:8fcb7576ad("media: ti-vpe: cal: Allow multiple contexts per subdev notifier") Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
640da89f3e
commit
b1f4731f33
|
|
@ -406,7 +406,7 @@ static irqreturn_t cal_irq(int irq_cal, void *data)
|
|||
*/
|
||||
|
||||
struct cal_v4l2_async_subdev {
|
||||
struct v4l2_async_subdev asd;
|
||||
struct v4l2_async_subdev asd; /* Must be first */
|
||||
struct cal_camerarx *phy;
|
||||
};
|
||||
|
||||
|
|
@ -472,7 +472,7 @@ static int cal_async_notifier_register(struct cal_dev *cal)
|
|||
fwnode = of_fwnode_handle(phy->sensor_node);
|
||||
asd = v4l2_async_notifier_add_fwnode_subdev(&cal->notifier,
|
||||
fwnode,
|
||||
sizeof(*asd));
|
||||
sizeof(*casd));
|
||||
if (IS_ERR(asd)) {
|
||||
phy_err(phy, "Failed to add subdev to notifier\n");
|
||||
ret = PTR_ERR(asd);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user