public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Hans Verkuil <hansverk@cisco.com>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: [PATCH] v4l2-compat-ioctl32.c: make ctrl_is_pointer work for subdevs
Date: Tue, 30 Jan 2018 19:49:32 +0200	[thread overview]
Message-ID: <1696034.lWE4eBQPQA@avalon> (raw)
In-Reply-To: <e72bf5c1-833e-ad7a-f92f-05527eabea14@cisco.com>

Hi Hans,

Thank you for the patch.

On Tuesday, 30 January 2018 17:18:32 EET Hans Verkuil wrote:
> If the device is of type VFL_TYPE_SUBDEV then vdev->ioctl_ops
> is NULL so the 'if (!ops->vidioc_query_ext_ctrl)' check would fail.

More than that, it would crash.

> Add a test for !ops to the condition.
> 
> All sub-devices that have controls will use the control framework,
> so they do not have an equivalent to ops->vidioc_query_ext_ctrl.
> Returning false if ops is NULL is the correct thing to do here.
> 
> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>

This is missing a Fixes: tag, and a Reported-by: tag would be nice too.

Apart from that,

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
> b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c index
> bdb5c226d01c..5198c9eeb348 100644
> --- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
> +++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c
> @@ -770,7 +770,7 @@ static inline bool ctrl_is_pointer(struct file *file,
> u32 id) return ctrl && ctrl->is_ptr;
>  	}
> 
> -	if (!ops->vidioc_query_ext_ctrl)
> +	if (!ops || !ops->vidioc_query_ext_ctrl)
>  		return false;
> 
>  	return !ops->vidioc_query_ext_ctrl(file, fh, &qec) &&

-- 
Regards,

Laurent Pinchart

      parent reply	other threads:[~2018-01-30 17:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-30 15:18 [PATCH] v4l2-compat-ioctl32.c: make ctrl_is_pointer work for subdevs Hans Verkuil
2018-01-30 16:10 ` Sakari Ailus
2018-01-30 17:49 ` Laurent Pinchart [this message]

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=1696034.lWE4eBQPQA@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=hansverk@cisco.com \
    --cc=linux-media@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox