mirror of
https://github.com/torvalds/linux.git
synced 2026-10-07 05:31:08 -04:00
media: v4l2-core: return -ENODEV from ioctl when not registered
I spotted a minor difference is handling of unregistered devices between native and compat ioctls: the native handler never tries to call into the driver if a device is not marked as registered. I did not check whether this can cause issues in the kernel, or just a different between return codes, but it clearly makes sense that both should behave the same way. Signed-off-by: Arnd Bergmann <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
This commit is contained in:
1 parent
765ba251d2
commit
8162f78d27
1 file changed
+3
@@ -1244,6 +1244,9 @@ long v4l2_compat_ioctl32(struct file *file, unsigned int cmd, unsigned long arg)
|
||||
if (!file->f_op->unlocked_ioctl)
|
||||
return ret;
|
||||
|
||||
if (!video_is_registered(vdev))
|
||||
return -ENODEV;
|
||||
|
||||
if (_IOC_TYPE(cmd) == 'V' && _IOC_NR(cmd) < BASE_VIDIOC_PRIVATE)
|
||||
ret = file->f_op->unlocked_ioctl(file, cmd,
|
||||
(unsigned long)compat_ptr(arg));
|
||||
|
||||
Reference in new issue
Block a user