All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: linux-media@vger.kernel.org
Cc: laurent.pinchart@ideasonboard.com,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	hverkuil@xs4all.nl
Subject: [PATCH 1/6] media: saa6752hs: Don't set format in sub-device state
Date: Thu,  7 Dec 2023 14:09:07 +0200	[thread overview]
Message-ID: <20231207120912.270716-2-sakari.ailus@linux.intel.com> (raw)
In-Reply-To: <20231207120912.270716-1-sakari.ailus@linux.intel.com>

For the purpose of setting old non-pad based sub-device try format as a
basis for VIDIOC_TRY_FMT implementation, there is no need to set the
format in the sub-device state. Drop the assignment to the state, which
would result in a NULL pointer dereference.

Fixes: fd17e3a9a788 ("media: i2c: Use accessors for pad config 'try_*' fields")
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
 drivers/media/i2c/saa6752hs.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/media/i2c/saa6752hs.c b/drivers/media/i2c/saa6752hs.c
index 51b62a97946a..897eaa669b86 100644
--- a/drivers/media/i2c/saa6752hs.c
+++ b/drivers/media/i2c/saa6752hs.c
@@ -594,10 +594,8 @@ static int saa6752hs_set_fmt(struct v4l2_subdev *sd,
 	f->field = V4L2_FIELD_INTERLACED;
 	f->colorspace = V4L2_COLORSPACE_SMPTE170M;
 
-	if (format->which == V4L2_SUBDEV_FORMAT_TRY) {
-		*v4l2_subdev_state_get_format(sd_state, 0) = *f;
+	if (format->which == V4L2_SUBDEV_FORMAT_TRY)
 		return 0;
-	}
 
 	/*
 	  FIXME: translate and round width/height into EMPRESS
-- 
2.39.2


  reply	other threads:[~2023-12-07 12:09 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 ` Sakari Ailus [this message]
2023-12-07 12:44   ` [PATCH 1/6] media: saa6752hs: Don't set format in " 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 ` [PATCH 0/6] Old non-MC-aware drivers have no " 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=20231207120912.270716-2-sakari.ailus@linux.intel.com \
    --to=sakari.ailus@linux.intel.com \
    --cc=hverkuil@xs4all.nl \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@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 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.