dect
/
linux-2.6
Archived
13
0
Fork 0

[media] media: fix MEDIA_IOC_DEVICE_INFO return code

The MEDIA_IOC_DEVICE_INFO ioctl was returning a positive value rather
than a negative error code when failing to copy output parameter to
user-space.

Tested by compilation only.

Signed-off-by: Nicolas Thery <nicolas.thery@st.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
Nicolas THERY 2012-08-07 05:24:59 -03:00 committed by Mauro Carvalho Chehab
parent ff54298bc7
commit b17d39453b
1 changed files with 3 additions and 1 deletions

View File

@ -59,7 +59,9 @@ static int media_device_get_info(struct media_device *dev,
info.hw_revision = dev->hw_revision;
info.driver_version = dev->driver_version;
return copy_to_user(__info, &info, sizeof(*__info));
if (copy_to_user(__info, &info, sizeof(*__info)))
return -EFAULT;
return 0;
}
static struct media_entity *find_entity(struct media_device *mdev, u32 id)