[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220211142752.779952-9-alexander.stein@ew.tq-group.com>
Date: Fri, 11 Feb 2022 15:27:51 +0100
From: Alexander Stein <alexander.stein@...tq-group.com>
To: Steve Longerbeam <slongerbeam@...il.com>,
Philipp Zabel <p.zabel@...gutronix.de>,
Mauro Carvalho Chehab <mchehab@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Fabio Estevam <festevam@...il.com>,
NXP Linux Team <linux-imx@....com>,
Rui Miguel Silva <rmfrfs@...il.com>,
Laurent Pinchart <laurent.pinchart@...asonboard.com>,
Dorota Czaplejewicz <dorota.czaplejewicz@...i.sm>
Cc: Alexander Stein <alexander.stein@...tq-group.com>,
linux-media@...r.kernel.org, linux-staging@...ts.linux.dev,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: [PATCH v2 8/9] media: imx: utils: initialize local variable
imx_media_enum_mbus_formats might not set code at all, this would result
in imx_media_find_mbus_format using an uninitialized variable.
Set code to 0 to avoid returning a wrong pixel format.
Signed-off-by: Alexander Stein <alexander.stein@...tq-group.com>
---
Changes in v2:
* New in v2
drivers/staging/media/imx/imx-media-utils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/media/imx/imx-media-utils.c b/drivers/staging/media/imx/imx-media-utils.c
index 57eb1c5897c0..025c080c8c9f 100644
--- a/drivers/staging/media/imx/imx-media-utils.c
+++ b/drivers/staging/media/imx/imx-media-utils.c
@@ -610,7 +610,7 @@ static int imx56_media_mbus_fmt_to_pix_fmt(struct v4l2_pix_format *pix,
* so until it does convert to a supported YUV format.
*/
if (cc->ipufmt && cc->cs == IPUV3_COLORSPACE_YUV) {
- u32 code;
+ u32 code = 0;
imx_media_enum_mbus_formats(&code, 0, PIXFMT_SEL_YUV);
cc = imx_media_find_mbus_format(code, PIXFMT_SEL_YUV);
--
2.25.1
Powered by blists - more mailing lists