All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: linux-media@vger.kernel.org
Cc: sakari.ailus@maxwell.research.nokia.com
Subject: [PATCH v1 4/8] v4l: Fix a use-before-set in the control framework
Date: Thu, 27 Jan 2011 13:31:08 +0100	[thread overview]
Message-ID: <1296131472-30045-5-git-send-email-laurent.pinchart@ideasonboard.com> (raw)
In-Reply-To: <1296131472-30045-1-git-send-email-laurent.pinchart@ideasonboard.com>

v4l2_queryctrl sets the step value based on the control type. That would
be fine if it used the control type stored in the V4L2 kernel control
object, not the one stored in the userspace ioctl structure that has
just been memset to 0. Fix this.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hverkuil@xs4all.nl>
---
 drivers/media/video/v4l2-ctrls.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/v4l2-ctrls.c b/drivers/media/video/v4l2-ctrls.c
index 9d2502c..5f74fec0 100644
--- a/drivers/media/video/v4l2-ctrls.c
+++ b/drivers/media/video/v4l2-ctrls.c
@@ -1338,7 +1338,7 @@ int v4l2_queryctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_queryctrl *qc)
 	qc->minimum = ctrl->minimum;
 	qc->maximum = ctrl->maximum;
 	qc->default_value = ctrl->default_value;
-	if (qc->type == V4L2_CTRL_TYPE_MENU)
+	if (ctrl->type == V4L2_CTRL_TYPE_MENU)
 		qc->step = 1;
 	else
 		qc->step = ctrl->step;
-- 
1.7.3.4


  parent reply	other threads:[~2011-01-27 12:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-27 12:31 [PATCH v1 0/8] Misc V4L2 patches for the OMAP3 ISP driver Laurent Pinchart
2011-01-27 12:31 ` [PATCH v1 1/8] v4l: subdev: Generic ioctl support Laurent Pinchart
2011-01-27 12:31 ` [PATCH v1 2/8] v4l: Add subdev sensor g_skip_frames operation Laurent Pinchart
2011-01-27 12:31 ` [PATCH v1 3/8] v4l: Include linux/videodev2.h in media/v4l2-ctrls.h Laurent Pinchart
2011-01-27 12:31 ` Laurent Pinchart [this message]
2011-01-27 12:31 ` [PATCH v1 5/8] v4l: Add 8-bit YUYV on 16-bit bus and SGRBG10 media bus pixel codes Laurent Pinchart
2011-01-27 12:31 ` [PATCH v1 6/8] v4l: Add remaining RAW10 patterns w DPCM pixel code variants Laurent Pinchart
2011-01-27 12:31 ` [PATCH v1 7/8] v4l: Add missing 12 bits bayer media bus formats Laurent Pinchart
2011-01-27 12:31 ` [PATCH v1 8/8] v4l: Add 12 bits bayer pixel formats Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1296131472-30045-5-git-send-email-laurent.pinchart@ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=sakari.ailus@maxwell.research.nokia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.