From nobody Tue Sep 9 21:32:25 2025 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2F49622258C; Sun, 7 Sep 2025 09:36:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.61.82.184 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757237780; cv=none; b=Dui2teuTtDEoRi30vKoKpBvyWXaUOkeVOD3an+h/Hy2IZfkGgSGuOhzIyHiE4uHleymOBTfNx30pxYzF22vtPIv48UVdWbyrfCvWlM0JBR2/KZXXp6VoohWmhoKBb6fw8N6AzT6dzCdLLXhLApbMb37lHotnFjme3lxsKnM+TVo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757237780; c=relaxed/simple; bh=xD+o0Tnnd1c0ny09FzZWl8KjVRO8ANiG87qGlfP63VA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=uKZ42X5HZy0CCCfQnIybjh4weKN0YBbERLpRCif5kNmxF3Sqr92IMa6DIIiXnNFYZjUeWr/vMzvpBCe1dIcV6Zg4+X8TDkr8I1YYM0MMLYbVk3TM39wyX4TJnY45mMW9Eks5kiS5eAJtJapfE1KdkC4Brdt3RgDU1EhInjS/dOQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com; spf=pass smtp.mailfrom=mediatek.com; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b=N8l1iIsO; arc=none smtp.client-ip=210.61.82.184 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mediatek.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="N8l1iIsO" X-UUID: 13ff39128bce11f0b33aeb1e7f16c2b6-20250907 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=EmUQrmXSZEqEeEm1CJwcJAW/kMlGcnsbm2PBBndWxJw=; b=N8l1iIsOUr2m44BdlSMgyDtYNuwzeOX6JOcirIW9XuDYjf9Gj5vuFe280RPqz+eNm1te+dBTzc06SszQsq+FuFhPDAWTcEII3mSaKVa555/cq8LvY1+Pprh/NjkhQ3/uGpkSsxACrkcHeqYuexrL+x/BaTvID5guuKMz3PNfQo0=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.3,REQID:4ee551a0-f209-4afc-bcb9-d63971334da8,IP:0,UR L:0,TC:0,Content:-25,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-25 X-CID-META: VersionHash:f1326cf,CLOUDID:ea420ca9-24df-464e-9c88-e53ab7cf7153,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:81|82|102,TC:-5,Content:0|15|50,EDM: -3,IP:nil,URL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0, AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: 13ff39128bce11f0b33aeb1e7f16c2b6-20250907 Received: from mtkmbs09n2.mediatek.inc [(172.21.101.94)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1679789353; Sun, 07 Sep 2025 17:36:06 +0800 Received: from mtkmbs11n1.mediatek.inc (172.21.101.185) by MTKMBS14N2.mediatek.inc (172.21.101.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.39; Sun, 7 Sep 2025 17:36:03 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs11n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1258.39 via Frontend Transport; Sun, 7 Sep 2025 17:36:02 +0800 From: Irui Wang To: Hans Verkuil , Mauro Carvalho Chehab , Matthias Brugger , , , Tiffany Lin , Yunfei Dong , Qianfeng Rong CC: Maoguang Meng , Longfei Wang , Irui Wang , , , , , Subject: [PATCH v3 1/2] media: mediatek: encoder: Fix uninitialized scalar variable issue Date: Sun, 7 Sep 2025 17:35:56 +0800 Message-ID: <20250907093557.8008-2-irui.wang@mediatek.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20250907093557.8008-1-irui.wang@mediatek.com> References: <20250907093557.8008-1-irui.wang@mediatek.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-MTK: N Content-Type: text/plain; charset="utf-8" UNINIT checker finds some instances of variables that are used without being initialized, for example using the uninitialized value enc_result.is_key_frm can result in unpredictable behavior, so initialize these variables after declaring. Fixes: 4e855a6efa54 ("[media] vcodec: mediatek: Add Mediatek V4L2 Video Enc= oder Driver") Signed-off-by: Irui Wang --- .../media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc.= c b/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc.c index a01dc25a7699..acf6ddca1c88 100644 --- a/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc.c +++ b/drivers/media/platform/mediatek/vcodec/encoder/mtk_vcodec_enc.c @@ -865,7 +865,7 @@ static void vb2ops_venc_buf_queue(struct vb2_buffer *vb) static int vb2ops_venc_start_streaming(struct vb2_queue *q, unsigned int c= ount) { struct mtk_vcodec_enc_ctx *ctx =3D vb2_get_drv_priv(q); - struct venc_enc_param param; + struct venc_enc_param param =3D { }; int ret; int i; =20 @@ -1019,7 +1019,7 @@ static int mtk_venc_encode_header(void *priv) int ret; struct vb2_v4l2_buffer *src_buf, *dst_buf; struct mtk_vcodec_mem bs_buf; - struct venc_done_result enc_result; + struct venc_done_result enc_result =3D { }; =20 dst_buf =3D v4l2_m2m_dst_buf_remove(ctx->m2m_ctx); if (!dst_buf) { @@ -1140,7 +1140,7 @@ static void mtk_venc_worker(struct work_struct *work) struct vb2_v4l2_buffer *src_buf, *dst_buf; struct venc_frm_buf frm_buf; struct mtk_vcodec_mem bs_buf; - struct venc_done_result enc_result; + struct venc_done_result enc_result =3D { }; int ret, i; =20 /* check dst_buf, dst_buf may be removed in device_run --=20 2.45.2