Skip to content

Commit 5d33213

Browse files
Dan CarpenterHans Verkuil
authored andcommitted
media: v4l2-subdev: Fix a 64bit bug
The problem is this line here from subdev_do_ioctl(). client_cap->capabilities &= ~V4L2_SUBDEV_CLIENT_CAP_STREAMS; The "client_cap->capabilities" variable is a u64. The AND operation is supposed to clear out the V4L2_SUBDEV_CLIENT_CAP_STREAMS flag. But because it's a 32 bit variable it accidentally clears out the high 32 bits as well. Currently we only use the first bit and none of the upper bits so this doesn't affect runtime behavior. Fixes: f57fa29 ("media: v4l2-subdev: Add new ioctl for client capabilities") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
1 parent 9ea7be9 commit 5d33213

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

include/uapi/linux/v4l2-subdev.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ struct v4l2_subdev_routing {
239239
* set (which is the default), the 'stream' fields will be forced to 0 by the
240240
* kernel.
241241
*/
242-
#define V4L2_SUBDEV_CLIENT_CAP_STREAMS (1U << 0)
242+
#define V4L2_SUBDEV_CLIENT_CAP_STREAMS (1ULL << 0)
243243

244244
/**
245245
* struct v4l2_subdev_client_capability - Capabilities of the client accessing

0 commit comments

Comments
 (0)