[media] media: fix truncated entity specification
When enumerating an entity, assign the entire entity specification instead of only the first two words. (This requires giving the specification union a name.) So far, no driver actually uses more than two words, but this will be needed for ALSA entities. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> [laurent.pinchart@ideasonboard.com: Rename specification to info] Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
committed by
Mauro Carvalho Chehab
parent
c1026c580d
commit
fa5034c667
@@ -108,8 +108,7 @@ static long media_device_enum_entities(struct media_device *mdev,
|
||||
u_ent.group_id = ent->group_id;
|
||||
u_ent.pads = ent->num_pads;
|
||||
u_ent.links = ent->num_links - ent->num_backlinks;
|
||||
u_ent.v4l.major = ent->v4l.major;
|
||||
u_ent.v4l.minor = ent->v4l.minor;
|
||||
memcpy(&u_ent.raw, &ent->info, sizeof(ent->info));
|
||||
if (copy_to_user(uent, &u_ent, sizeof(u_ent)))
|
||||
return -EFAULT;
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user