diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2011-11-05 17:42:01 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-12-20 06:31:50 -0500 |
commit | fa5034c667c224be48db31a0d043dba305e8e7a8 (patch) | |
tree | f5b74b0c5c23797016fa5357e396e10e11d8c3c8 /drivers/media/media-device.c | |
parent | c1026c580df130c1d1943fff99bae0bef2cafa7b (diff) |
[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>
Diffstat (limited to 'drivers/media/media-device.c')
-rw-r--r-- | drivers/media/media-device.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c index 6edc9ba81203..6f9eb94e85b3 100644 --- a/drivers/media/media-device.c +++ b/drivers/media/media-device.c | |||
@@ -108,8 +108,7 @@ static long media_device_enum_entities(struct media_device *mdev, | |||
108 | u_ent.group_id = ent->group_id; | 108 | u_ent.group_id = ent->group_id; |
109 | u_ent.pads = ent->num_pads; | 109 | u_ent.pads = ent->num_pads; |
110 | u_ent.links = ent->num_links - ent->num_backlinks; | 110 | u_ent.links = ent->num_links - ent->num_backlinks; |
111 | u_ent.v4l.major = ent->v4l.major; | 111 | memcpy(&u_ent.raw, &ent->info, sizeof(ent->info)); |
112 | u_ent.v4l.minor = ent->v4l.minor; | ||
113 | if (copy_to_user(uent, &u_ent, sizeof(u_ent))) | 112 | if (copy_to_user(uent, &u_ent, sizeof(u_ent))) |
114 | return -EFAULT; | 113 | return -EFAULT; |
115 | return 0; | 114 | return 0; |