Commit 914282c6 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Greg Kroah-Hartman

media: dvb: fix compat ioctl translation

[ Upstream commit 1ccbeeb8 ]

The VIDEO_GET_EVENT and VIDEO_STILLPICTURE was added back in 2005 but
it never worked because the command number is wrong.

Using the right command number means we have a better chance of them
actually doing the right thing, though clearly nobody has ever tried
it successfully.

I noticed these while auditing the remaining users of compat_time_t
for y2038 bugs. This one is fine in that regard, it just never did
anything.

Fixes: 6e87abd0 ("[DVB]: Add compat ioctl handling.")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 03056f8c
...@@ -141,6 +141,7 @@ struct compat_video_event { ...@@ -141,6 +141,7 @@ struct compat_video_event {
unsigned int frame_rate; unsigned int frame_rate;
} u; } u;
}; };
#define VIDEO_GET_EVENT32 _IOR('o', 28, struct compat_video_event)
static int do_video_get_event(struct file *file, static int do_video_get_event(struct file *file,
unsigned int cmd, struct compat_video_event __user *up) unsigned int cmd, struct compat_video_event __user *up)
...@@ -152,7 +153,7 @@ static int do_video_get_event(struct file *file, ...@@ -152,7 +153,7 @@ static int do_video_get_event(struct file *file,
if (kevent == NULL) if (kevent == NULL)
return -EFAULT; return -EFAULT;
err = do_ioctl(file, cmd, (unsigned long)kevent); err = do_ioctl(file, VIDEO_GET_EVENT, (unsigned long)kevent);
if (!err) { if (!err) {
err = convert_in_user(&kevent->type, &up->type); err = convert_in_user(&kevent->type, &up->type);
err |= convert_in_user(&kevent->timestamp, &up->timestamp); err |= convert_in_user(&kevent->timestamp, &up->timestamp);
...@@ -171,6 +172,7 @@ struct compat_video_still_picture { ...@@ -171,6 +172,7 @@ struct compat_video_still_picture {
compat_uptr_t iFrame; compat_uptr_t iFrame;
int32_t size; int32_t size;
}; };
#define VIDEO_STILLPICTURE32 _IOW('o', 30, struct compat_video_still_picture)
static int do_video_stillpicture(struct file *file, static int do_video_stillpicture(struct file *file,
unsigned int cmd, struct compat_video_still_picture __user *up) unsigned int cmd, struct compat_video_still_picture __user *up)
...@@ -193,7 +195,7 @@ static int do_video_stillpicture(struct file *file, ...@@ -193,7 +195,7 @@ static int do_video_stillpicture(struct file *file,
if (err) if (err)
return -EFAULT; return -EFAULT;
err = do_ioctl(file, cmd, (unsigned long) up_native); err = do_ioctl(file, VIDEO_STILLPICTURE, (unsigned long) up_native);
return err; return err;
} }
...@@ -1302,9 +1304,9 @@ static long do_ioctl_trans(unsigned int cmd, ...@@ -1302,9 +1304,9 @@ static long do_ioctl_trans(unsigned int cmd,
return rtc_ioctl(file, cmd, argp); return rtc_ioctl(file, cmd, argp);
/* dvb */ /* dvb */
case VIDEO_GET_EVENT: case VIDEO_GET_EVENT32:
return do_video_get_event(file, cmd, argp); return do_video_get_event(file, cmd, argp);
case VIDEO_STILLPICTURE: case VIDEO_STILLPICTURE32:
return do_video_stillpicture(file, cmd, argp); return do_video_stillpicture(file, cmd, argp);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment