From patchwork Thu Dec 7 12:09:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 13483196 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="d10+2Tc5" Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0AA93D7E for ; Thu, 7 Dec 2023 04:09:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701950959; x=1733486959; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=2C8T7FBa/G498XnHJNybLAu50UpyDAXmJBvFJLW5I08=; b=d10+2Tc5SIXVp5qLQ30mbo62yajnidjW768bArPcJp0k51HoPn6P2LMq sd+txtI/bUw8qENB7+/AiJyHk8yHvYrnl3ydmIpDG5EG4/0v6Yc81przd +T9tBPfrfjELA6bKUZyM+8gOMT0CLFkc9SA8KFNIBZ/pAe/fU04xAylXw uPjdei25XI7rpaDnhSRIBCL2vYLgT/p4r31SjssdLA/Ib+c38GJSkWH5o qHCEab5YI3fYjZMarXZfO/mub+TkBQ8IXD6Kwji6HVGI1Lod8Ao70yHC0 vyLhiEe70Ri/bhxSoXz/OfwVkONtf0oAFgnxG30fHGp9eOpBOxAuwhW69 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10916"; a="373707147" X-IronPort-AV: E=Sophos;i="6.04,256,1695711600"; d="scan'208";a="373707147" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2023 04:09:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,256,1695711600"; d="scan'208";a="19684500" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2023 04:09:17 -0800 Received: from svinhufvud.ger.corp.intel.com (localhost [IPv6:::1]) by kekkonen.fi.intel.com (Postfix) with ESMTP id A977711FB5E; Thu, 7 Dec 2023 14:09:13 +0200 (EET) From: Sakari Ailus To: linux-media@vger.kernel.org Cc: laurent.pinchart@ideasonboard.com, Mauro Carvalho Chehab , 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 Message-Id: <20231207120912.270716-2-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231207120912.270716-1-sakari.ailus@linux.intel.com> References: <20231207120912.270716-1-sakari.ailus@linux.intel.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 Reviewed-by: Laurent Pinchart --- 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 From patchwork Thu Dec 7 12:09:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 13483197 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="bkziG30w" Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27C3110C6 for ; Thu, 7 Dec 2023 04:09:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701950960; x=1733486960; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=GSgi0tL4yGJi8PQACw5oHV6gS/CCmaQL8XKqtwK70mE=; b=bkziG30wAmSEmobou8/eBD513dgInQszoAUpT7JlASNDYuHL4ocDqGeY N+xKpYcVLOsPtO5ygKokmOm2JdW/dXVBHgnzZTRSxckziU+eQBSUQX7/1 JRL0+2hphPp1hvYEbi8d7iqoUYoYUqvZ1Ai3nj2hKa07bK5qaV1s+nnFG Bq7JDiTw3c358iJ0HYPhw/V23EMOdMchgV03aBXe90IIcQ75n+8FetVtu RlgozmFrM5IbePTzJuvSsuK5oifcZIzElgK5ziqHnfr6HzyjS3TJx8ejr gY9stAcXt72iM8LFZqy4yh3KbG4WdlPKpz0BgbBaWVv5aBdfsblbyzahb w==; X-IronPort-AV: E=McAfee;i="6600,9927,10916"; a="373707151" X-IronPort-AV: E=Sophos;i="6.04,256,1695711600"; d="scan'208";a="373707151" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2023 04:09:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,256,1695711600"; d="scan'208";a="19684501" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2023 04:09:17 -0800 Received: from svinhufvud.ger.corp.intel.com (localhost [IPv6:::1]) by kekkonen.fi.intel.com (Postfix) with ESMTP id 91722120A0C; Thu, 7 Dec 2023 14:09:14 +0200 (EET) From: Sakari Ailus To: linux-media@vger.kernel.org Cc: laurent.pinchart@ideasonboard.com, Mauro Carvalho Chehab , hverkuil@xs4all.nl Subject: [PATCH 2/6] media: adv7183: Don't set format in sub-device state Date: Thu, 7 Dec 2023 14:09:08 +0200 Message-Id: <20231207120912.270716-3-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231207120912.270716-1-sakari.ailus@linux.intel.com> References: <20231207120912.270716-1-sakari.ailus@linux.intel.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 Reviewed-by: Laurent Pinchart --- drivers/media/i2c/adv7183.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/media/i2c/adv7183.c b/drivers/media/i2c/adv7183.c index bcb99ba9a272..2a2cace4a153 100644 --- a/drivers/media/i2c/adv7183.c +++ b/drivers/media/i2c/adv7183.c @@ -442,8 +442,6 @@ static int adv7183_set_fmt(struct v4l2_subdev *sd, } if (format->which == V4L2_SUBDEV_FORMAT_ACTIVE) decoder->fmt = *fmt; - else - *v4l2_subdev_state_get_format(sd_state, 0) = *fmt; return 0; } From patchwork Thu Dec 7 12:09:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 13483198 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ZQQBA3/R" Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81875D5C for ; Thu, 7 Dec 2023 04:09:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701950960; x=1733486960; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=d9HAych0ihFgbCxGHHERge9Ht4w92bpaGWnQZ7SHAxs=; b=ZQQBA3/Rt8N6otyRIUNbVAOIjWwkjgGynPchMRRC3hs6oQbZ7Obs0vLV tEsnWzOXkJPz+U//j0wWrcgDJdh8jSTXRcADsOYEAwTWt/6D+8n4/UQ6Q MxQfKBnrR+l/iVFvusAM32n042HNzB7yG6jM3VcM4Vtp4NMGhRc3NR3Zr rOJbQZtzSzQlpXFGgpVBUMUiydG5XLjUp+p9uTs3TWpBo7NADeFQfx0qE lnHMgWvKYmnV3dJA6t0KBnnLZCHRPMBiqDTKG3aBVpJZgan8FrxCDsk4U YWhnFuFqE/jxlgW/16ZbYYDCNl/8sXrAsJkNI+8oSOhTogm7hARb6W08b w==; X-IronPort-AV: E=McAfee;i="6600,9927,10916"; a="373707155" X-IronPort-AV: E=Sophos;i="6.04,256,1695711600"; d="scan'208";a="373707155" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2023 04:09:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,256,1695711600"; d="scan'208";a="19684502" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2023 04:09:18 -0800 Received: from svinhufvud.ger.corp.intel.com (localhost [IPv6:::1]) by kekkonen.fi.intel.com (Postfix) with ESMTP id 440EE120ADB; Thu, 7 Dec 2023 14:09:15 +0200 (EET) From: Sakari Ailus To: linux-media@vger.kernel.org Cc: laurent.pinchart@ideasonboard.com, Mauro Carvalho Chehab , hverkuil@xs4all.nl Subject: [PATCH 3/6] media: mt9t112: Don't set format in sub-device state Date: Thu, 7 Dec 2023 14:09:09 +0200 Message-Id: <20231207120912.270716-4-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231207120912.270716-1-sakari.ailus@linux.intel.com> References: <20231207120912.270716-1-sakari.ailus@linux.intel.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 Reviewed-by: Laurent Pinchart --- drivers/media/i2c/mt9t112.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/media/i2c/mt9t112.c b/drivers/media/i2c/mt9t112.c index 2e2d9853c089..fb1588c57cc8 100644 --- a/drivers/media/i2c/mt9t112.c +++ b/drivers/media/i2c/mt9t112.c @@ -982,7 +982,6 @@ static int mt9t112_set_fmt(struct v4l2_subdev *sd, if (format->which == V4L2_SUBDEV_FORMAT_ACTIVE) return mt9t112_s_fmt(sd, mf); - *v4l2_subdev_state_get_format(sd_state, 0) = *mf; return 0; } From patchwork Thu Dec 7 12:09:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 13483199 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="BSiCY3ok" Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 919B610C9 for ; Thu, 7 Dec 2023 04:09:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701950961; x=1733486961; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jV6z+C3b4RORasxjh4WphkKnfuADGfBIcv/kQUBf6mw=; b=BSiCY3okM6tbd/HHCRZe+5AXH5TZQsMLF0K0i33la63A2/AvykUJZIIm RzcDMRVvmWYVWMvjcUXC1qrWtCYMwealIGX201K8FDsBXwAcQQKO9Ijof OEgGkCuCBx2zq4UcLBqkY/s34BCNanXJ2R08X4yzCY2adjbPaTM3VYLFp i8WgAbRyuP47/akTLn0wv3ysKRANjk0uiGcTHheH7tlQUs36yO/UkwMb3 bA59ch1C+/soAum+icAn7oqXZqvOAFgxEn2FA+6VMdqdziN90AWwI8JlN S9R1YE7b8OtiTIiIEwWL2ZI4Wb6zuThw7JLujFI/Nr+TllNd5XBhn3NTk Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10916"; a="373707159" X-IronPort-AV: E=Sophos;i="6.04,256,1695711600"; d="scan'208";a="373707159" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2023 04:09:20 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,256,1695711600"; d="scan'208";a="19684504" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2023 04:09:19 -0800 Received: from svinhufvud.ger.corp.intel.com (localhost [IPv6:::1]) by kekkonen.fi.intel.com (Postfix) with ESMTP id F1CCA120E08; Thu, 7 Dec 2023 14:09:15 +0200 (EET) From: Sakari Ailus To: linux-media@vger.kernel.org Cc: laurent.pinchart@ideasonboard.com, Mauro Carvalho Chehab , hverkuil@xs4all.nl Subject: [PATCH 4/6] media: rj54n1cb0c: Don't set format in sub-device state Date: Thu, 7 Dec 2023 14:09:10 +0200 Message-Id: <20231207120912.270716-5-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231207120912.270716-1-sakari.ailus@linux.intel.com> References: <20231207120912.270716-1-sakari.ailus@linux.intel.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 Reviewed-by: Laurent Pinchart --- drivers/media/i2c/rj54n1cb0c.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/media/i2c/rj54n1cb0c.c b/drivers/media/i2c/rj54n1cb0c.c index 403185b18f06..a59db10153cd 100644 --- a/drivers/media/i2c/rj54n1cb0c.c +++ b/drivers/media/i2c/rj54n1cb0c.c @@ -1008,10 +1008,8 @@ static int rj54n1_set_fmt(struct v4l2_subdev *sd, v4l_bound_align_image(&mf->width, 112, RJ54N1_MAX_WIDTH, align, &mf->height, 84, RJ54N1_MAX_HEIGHT, align, 0); - if (format->which == V4L2_SUBDEV_FORMAT_TRY) { - *v4l2_subdev_state_get_format(sd_state, 0) = *mf; + if (format->which == V4L2_SUBDEV_FORMAT_TRY) return 0; - } /* * Verify if the sensor has just been powered on. TODO: replace this From patchwork Thu Dec 7 12:09:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 13483201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ki84539p" Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90F5E10CB for ; Thu, 7 Dec 2023 04:09:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701950962; x=1733486962; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=oclJQL5S3ifmXzvonTJkPWlCo8AL9JfcC4eF+0nK2cU=; b=ki84539pMby0Xfc3VZggoVEwaNJ9DwNCiCPeB49NSxpX4c+9vCg3eIOP xi+86ZOeO41tEG2AZk6Np2hoFJp4kSB81oG53tKu8Aj5sxE9KxApwq/7k VAMd+krQt0x72reDx/K/JmW2jyMF9PwYE/JlcNdntA7m/+40DEY8Wq/Bt rHF4WUDRulkPrJjd1xz28iKKtR3mlhfmwPLiOa5V0Vfd//L6xi23XTiTL pAZr9FiBtRN67OCXpl8x1Scn/yqzzJ7VEKmDf+Mv+QYFGHNqHwCxjojpA G1Aycp7dPg2NhGCHbbpyVsF0SnihYuhTgZj21k7SeBiEpAmDESUE+9Q4f w==; X-IronPort-AV: E=McAfee;i="6600,9927,10916"; a="373707163" X-IronPort-AV: E=Sophos;i="6.04,256,1695711600"; d="scan'208";a="373707163" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2023 04:09:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,256,1695711600"; d="scan'208";a="19684505" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2023 04:09:20 -0800 Received: from svinhufvud.ger.corp.intel.com (localhost [IPv6:::1]) by kekkonen.fi.intel.com (Postfix) with ESMTP id AE59D120EE4; Thu, 7 Dec 2023 14:09:16 +0200 (EET) From: Sakari Ailus To: linux-media@vger.kernel.org Cc: laurent.pinchart@ideasonboard.com, Mauro Carvalho Chehab , hverkuil@xs4all.nl Subject: [PATCH 5/6] media: tw9910: Don't set format in sub-device state Date: Thu, 7 Dec 2023 14:09:11 +0200 Message-Id: <20231207120912.270716-6-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231207120912.270716-1-sakari.ailus@linux.intel.com> References: <20231207120912.270716-1-sakari.ailus@linux.intel.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 Reviewed-by: Laurent Pinchart --- drivers/media/i2c/tw9910.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/media/i2c/tw9910.c b/drivers/media/i2c/tw9910.c index 7c331a7f12d4..905af98c7d53 100644 --- a/drivers/media/i2c/tw9910.c +++ b/drivers/media/i2c/tw9910.c @@ -829,8 +829,6 @@ static int tw9910_set_fmt(struct v4l2_subdev *sd, if (format->which == V4L2_SUBDEV_FORMAT_ACTIVE) return tw9910_s_fmt(sd, mf); - *v4l2_subdev_state_get_format(sd_state, 0) = *mf; - return 0; } From patchwork Thu Dec 7 12:09:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 13483200 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ihIBirnW" Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3D5410D0 for ; Thu, 7 Dec 2023 04:09:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701950962; x=1733486962; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=DXBEbzyL7p6PpuTnXRJbCmBTKP+z+AGNkitoxS6Bwtc=; b=ihIBirnWT6CpKhxNzrry6aAJ3LiHKmUTHm39tb2tshXmkEHXB7ogukkd W/xd+6tavNf1EZUMoKP5fUXYjKAB3BkbDDD1vz7PBqqxes1dYnrv6nYVH 11rgu02IMY8+0NWvWZ/L0tGk1zPwP/+O8K9p9ZQBEDnmy4pGoFZ9AIwEA 7sjnZUrbzxrckfdbN+Jn+msqbfeT4eHIRrGKpxKEEkGFmf1O+g7Dvquk0 DZSCOILC0EzzwAqW8A0F6eNLWytJwL7Q5CQKpw0DPELruQd1nRKnVSJ9R HHGegZKEI2Vmua3KyDOISj4AWSw/asYrH3kXdg8VVBk484Imz1PlrEREe A==; X-IronPort-AV: E=McAfee;i="6600,9927,10916"; a="373707167" X-IronPort-AV: E=Sophos;i="6.04,256,1695711600"; d="scan'208";a="373707167" Received: from orviesa001.jf.intel.com ([10.64.159.141]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2023 04:09:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,256,1695711600"; d="scan'208";a="19684506" Received: from turnipsi.fi.intel.com (HELO kekkonen.fi.intel.com) ([10.237.72.44]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2023 04:09:20 -0800 Received: from svinhufvud.ger.corp.intel.com (localhost [IPv6:::1]) by kekkonen.fi.intel.com (Postfix) with ESMTP id 685D8120F14; Thu, 7 Dec 2023 14:09:17 +0200 (EET) From: Sakari Ailus To: linux-media@vger.kernel.org Cc: laurent.pinchart@ideasonboard.com, Mauro Carvalho Chehab , hverkuil@xs4all.nl Subject: [PATCH 6/6] media: ov9640: Don't set format in sub-device state Date: Thu, 7 Dec 2023 14:09:12 +0200 Message-Id: <20231207120912.270716-7-sakari.ailus@linux.intel.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231207120912.270716-1-sakari.ailus@linux.intel.com> References: <20231207120912.270716-1-sakari.ailus@linux.intel.com> Precedence: bulk X-Mailing-List: linux-media@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 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 Reviewed-by: Laurent Pinchart --- drivers/media/i2c/ov9640.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/media/i2c/ov9640.c b/drivers/media/i2c/ov9640.c index b0c171fe75bc..e9a52a8a9dc0 100644 --- a/drivers/media/i2c/ov9640.c +++ b/drivers/media/i2c/ov9640.c @@ -547,8 +547,6 @@ static int ov9640_set_fmt(struct v4l2_subdev *sd, if (format->which == V4L2_SUBDEV_FORMAT_ACTIVE) return ov9640_s_fmt(sd, mf); - *v4l2_subdev_state_get_format(sd_state, 0) = *mf; - return 0; }