diff options
author | Nicolas THERY <nicolas.thery@st.com> | 2012-08-07 04:24:59 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-08-12 06:57:57 -0400 |
commit | b17d39453b40730cbfdb2cab9565f8ba8627b7f8 (patch) | |
tree | 015ec65bc173188bb70a5a6247744bb66a579672 /drivers/media/media-device.c | |
parent | ff54298bc743c42fac205c0fc1b62271682b3668 (diff) |
[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>
Diffstat (limited to 'drivers/media/media-device.c')
-rw-r--r-- | drivers/media/media-device.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c index 6f9eb94e85b3..d01fcb7e87c2 100644 --- a/drivers/media/media-device.c +++ b/drivers/media/media-device.c | |||
@@ -59,7 +59,9 @@ static int media_device_get_info(struct media_device *dev, | |||
59 | info.hw_revision = dev->hw_revision; | 59 | info.hw_revision = dev->hw_revision; |
60 | info.driver_version = dev->driver_version; | 60 | info.driver_version = dev->driver_version; |
61 | 61 | ||
62 | return copy_to_user(__info, &info, sizeof(*__info)); | 62 | if (copy_to_user(__info, &info, sizeof(*__info))) |
63 | return -EFAULT; | ||
64 | return 0; | ||
63 | } | 65 | } |
64 | 66 | ||
65 | static struct media_entity *find_entity(struct media_device *mdev, u32 id) | 67 | static struct media_entity *find_entity(struct media_device *mdev, u32 id) |