提交 b17d3945 编写于 作者: N Nicolas THERY 提交者: Mauro Carvalho Chehab

[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: NNicolas Thery <nicolas.thery@st.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 ff54298b
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册