Skip to content

Commit

Permalink
media: zero reservedX fields in media_v2_topology
Browse files Browse the repository at this point in the history
The MEDIA_IOC_G_TOPOLOGY implementation did not zero the reservedX fields.
Fix this.

Found with v4l2-compliance.

Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
hverkuil authored and mchehab committed Feb 26, 2018
1 parent 81e0989 commit baa9e91
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/media/media-device.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ static long media_device_get_topology(struct media_device *mdev,
uentity++;
}
topo->num_entities = i;
topo->reserved1 = 0;

/* Get interfaces and number of interfaces */
i = 0;
Expand Down Expand Up @@ -301,6 +302,7 @@ static long media_device_get_topology(struct media_device *mdev,
uintf++;
}
topo->num_interfaces = i;
topo->reserved2 = 0;

/* Get pads and number of pads */
i = 0;
Expand All @@ -327,6 +329,7 @@ static long media_device_get_topology(struct media_device *mdev,
upad++;
}
topo->num_pads = i;
topo->reserved3 = 0;

/* Get links and number of links */
i = 0;
Expand Down Expand Up @@ -358,6 +361,7 @@ static long media_device_get_topology(struct media_device *mdev,
ulink++;
}
topo->num_links = i;
topo->reserved4 = 0;

return ret;
}
Expand Down

0 comments on commit baa9e91

Please sign in to comment.