From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: linux-media@vger.kernel.org,
Mauro Carvalho Chehab <mchehab@kernel.org>,
hverkuil@xs4all.nl
Subject: Re: [PATCH 0/6] Old non-MC-aware drivers have no sub-device state
Date: Thu, 7 Dec 2023 14:48:42 +0200 [thread overview]
Message-ID: <20231207124842.GI9675@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20231207120912.270716-1-sakari.ailus@linux.intel.com>
On Thu, Dec 07, 2023 at 02:09:06PM +0200, Sakari Ailus wrote:
> Hi folks,
>
> This set replaces the earlier attempt to fix non-MC-aware sub-device
> drivers that still use the set_fmt and similar sub-device ops. These
> drivers have been converted from the olf set_fmt etc. video ops.
>
> The issue here is that the caller does not initialise the full sub-device
> state so the sd field of struct v4l2_subdev_state is NULL, leading
> currently to NULL pointer dereference, even if the code compiles. This was
> not the case before commit fd17e3a9a7886ec949ce269a396b67875b51ff45 .
>
> Even then, there's no need to access the sub-device state as the format
> (or selection rectangle) won't be stored for a longer period of time: the
> caller (saa7134 driver) simply uses the original configuration to obtain
> the changed value.
Just a note that he caller for the other subdev drivers, renesas-ceu,
does exactly the same thing, so the same fix is applicable.
> This patchset does not address similar issues in the ov6650 driver.
The driver is not used in mainline anymore. It was merged for an old
OMAP1 device that has been dropped from the kernel.
I wonder if we should start moving some sensor drivers to staging...
> Sakari Ailus (6):
> media: saa6752hs: Don't set format in sub-device state
> media: adv7183: Don't set format in sub-device state
> media: mt9t112: Don't set format in sub-device state
> media: rj54n1cb0c: Don't set format in sub-device state
> media: tw9910: Don't set format in sub-device state
> media: ov9640: Don't set format in sub-device state
>
> drivers/media/i2c/adv7183.c | 2 --
> drivers/media/i2c/mt9t112.c | 1 -
> drivers/media/i2c/ov9640.c | 2 --
> drivers/media/i2c/rj54n1cb0c.c | 4 +---
> drivers/media/i2c/saa6752hs.c | 4 +---
> drivers/media/i2c/tw9910.c | 2 --
> 6 files changed, 2 insertions(+), 13 deletions(-)
--
Regards,
Laurent Pinchart
prev parent reply other threads:[~2023-12-07 12:48 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-07 12:09 [PATCH 0/6] Old non-MC-aware drivers have no sub-device state Sakari Ailus
2023-12-07 12:09 ` [PATCH 1/6] media: saa6752hs: Don't set format in " Sakari Ailus
2023-12-07 12:44 ` Laurent Pinchart
2023-12-07 12:09 ` [PATCH 2/6] media: adv7183: " Sakari Ailus
2023-12-07 12:44 ` Laurent Pinchart
2023-12-07 12:09 ` [PATCH 3/6] media: mt9t112: " Sakari Ailus
2023-12-07 12:45 ` Laurent Pinchart
2023-12-07 12:09 ` [PATCH 4/6] media: rj54n1cb0c: " Sakari Ailus
2023-12-07 12:45 ` Laurent Pinchart
2023-12-07 12:09 ` [PATCH 5/6] media: tw9910: " Sakari Ailus
2023-12-07 12:45 ` Laurent Pinchart
2023-12-07 12:09 ` [PATCH 6/6] media: ov9640: " Sakari Ailus
2023-12-07 12:46 ` Laurent Pinchart
2023-12-07 12:48 ` 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=20231207124842.GI9675@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.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.