Skip to content

Old non-MC-aware drivers have no sub-device state

Sakari Ailus linux-media 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6media: saa6752hs: Don't set format in sub-device statedrivers/media/i2c/saa6752hs.c+1 -31 reply
2/6media: adv7183: Don't set format in sub-device statedrivers/media/i2c/adv7183.c+0 -21 reply
3/6media: mt9t112: Don't set format in sub-device statedrivers/media/i2c/mt9t112.c+0 -11 reply
4/6media: rj54n1cb0c: Don't set format in sub-device statedrivers/media/i2c/rj54n1cb0c.c+1 -31 reply
5/6media: tw9910: Don't set format in sub-device statedrivers/media/i2c/tw9910.c+0 -21 reply
6/6media: ov9640: Don't set format in sub-device statedrivers/media/i2c/ov9640.c+0 -21 reply

Reviews trailers per patch

All 6 patches have a Reviewed-by or Acked-by.

PatchLaurent Pinchart
1/6R-b
2/6R-b
3/6R-b
4/6R-b
5/6R-b
6/6R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/6] Old non-MC-aware drivers have no sub-device state

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.

This patchset does not address similar issues in the ov6650 driver.

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(-)
Signature · 1 line
2.39.2