[PATCH] v4l: subdev: compat: update handling for VIDIOC_SUBDEV_[GS]_ROUTING

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Implement compat IOCTL handling for VIDIOC_SUBDEV_G_ROUTING and
VIDIOC_SUBDEV_S_ROUTING IOCTLs.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@xxxxxxxxxxxx>
---
 drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Hi Sakari,

With this fix on-top of your vc branch I get it work with v4.16-rc1, 
feel free to squash it into your branch where appropriate. I tested this 
with a ARM64 kernel and a ARM user-land with v4l2-ctl + my 
--{get,set}-routing patches for v4l-utils.

// Niklas

diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
index a1f71a83ac076d7f..30700658963d3227 100644
--- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
+++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
@@ -1124,7 +1124,10 @@ static long do_video_ioctl(struct file *file, unsigned int cmd, unsigned long ar
 
 	case VIDIOC_SUBDEV_G_ROUTING:
 	case VIDIOC_SUBDEV_S_ROUTING:
-		err = get_v4l2_subdev_routing(&karg.subdev_routing, up);
+		err = alloc_userspace(sizeof(struct v4l2_subdev_routing),
+				      0, &up_native);
+		if (!err)
+			err = get_v4l2_subdev_routing(up_native, up);
 		compatible_arg = 0;
 		break;
 
@@ -1257,7 +1260,7 @@ static long do_video_ioctl(struct file *file, unsigned int cmd, unsigned long ar
 		break;
 	case VIDIOC_SUBDEV_G_ROUTING:
 	case VIDIOC_SUBDEV_S_ROUTING:
-		err = put_v4l2_subdev_routing(&karg.subdev_routing, up);
+		err = put_v4l2_subdev_routing(up_native, up);
 		break;
 	}
 	if (err)
-- 
2.16.1




[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux