Skip to content

Commit

Permalink
[media] media: fix MEDIA_IOC_DEVICE_INFO return code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Nicolas THERY authored and Mauro Carvalho Chehab committed Aug 12, 2012
1 parent ff54298 commit b17d394
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/media/media-device.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit b17d394

Please sign in to comment.