From patchwork Tue Jul 18 09:50:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ming Qian X-Patchwork-Id: 13318387 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AF118C001DE for ; Wed, 19 Jul 2023 06:52:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=oVxfsQvuglq4vpzFzzUdweHHpVyT7H14SLtvudHVtME=; b=KhSY5UaLyiybAb bFOpz0hd3GeA5fWRDRDnHcuRckSg8m9LC5ktpG61lwCBVwYyNMbpN3L8a+VudWoOE6OMNoK94BD+H IZJCzhIjxakDzqjTq7x03PDqJNn0Vref/oXDRH/bJBWF87xJ0qJvLhcfcJGP6lUUNTpHdYE0g46Di A2tw4V3unQTssVwYc/nCoj93Wip9178AovTNS3C3pFgXDFu/XOfDHI4XpVNsqmCC1yVTvxAhHIJon K5WGCHDjB/zgysFCXFH7tgMnbR8VtER0lmFSCC7hvco8+fqXeswUi+GAownSHd0qv4yfQsU16yQLn CdP9JDiEYcnl7uobHG0A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qM12G-005w56-0p; Wed, 19 Jul 2023 06:51:44 +0000 Received: from desiato.infradead.org ([2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qM129-005w1K-0r for linux-arm-kernel@bombadil.infradead.org; Wed, 19 Jul 2023 06:51:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=MIME-Version:Content-Type: Content-Transfer-Encoding:References:In-Reply-To:Message-Id:Date:Subject:Cc: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=vSDokErEW24Y+K/+FEmUkfXUYoJN/EsPto2y3M0PEqQ=; b=TU2Ce4WBQXMzKaSInzcvoHlW7e OVq3Hnb1BsDVhxqficjbRhxbpVIF16+G3sQA59JgvgpOHXU4JpXVCzesObOxseJvNGN4RHtFjjpGy n1KuZL7+9reQ9MTlmsSDQqctrRKy8cPZIZawGox0Bvq6Ry4uhsMuWWdBIIu0VImz/HfTauQcsUGZD 4LLxhBEuiIXciNsqvPNrJv+LQIsEb6hFmUUHAGamRtgK9iqFtqD3lpLrXdYDvZNul8jSy0Q7guAC7 nDdO9tRpZsjWv/HSOtdjixyaVbsSU8iLEKiJaMjubDrRBIISHKcBdGcRADeUusAfV4QlUjMv0a4wN eMm1MMoA==; Received: from mail-ve1eur01on0631.outbound.protection.outlook.com ([2a01:111:f400:fe1f::631] helo=EUR01-VE1-obe.outbound.protection.outlook.com) by desiato.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qLhas-00BOjP-2y for linux-arm-kernel@lists.infradead.org; Tue, 18 Jul 2023 10:06:12 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jf3roXMZpezT5PLPEiFdYC6UZg3lp1tZAlB1+JnwZRkyt5uguQUSgeob1J/QnOZWRPI957ZbXt4gVPGiJnMIRoPSNwZOkqHbKkqKbYwCSojegteEHvMO1JEKmnLTM3k+Wq3LGEh0MAEcyhjoxQb1PyOFHLtfLBJKoca8ELJ3r61CeKdrhKnTF/P5pjuKxmxSH8Sm+LJz2IVy1lYMrewcB2NJuBtsXmZVyLoqRmmhHsBYALSJeGAWnD602Gr3fnYk04o57tXeY01Q5X2ca3R7J8Vki0KVR2WSPpwoNYdpoaCXCLULsOX+YXe5MEFO9spmqMdK5Nxr1w9IAvQCiqNI0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=vSDokErEW24Y+K/+FEmUkfXUYoJN/EsPto2y3M0PEqQ=; b=VEqDS8Xo2R0V/c5v8IZ1hHpNbYaUhv+4ft0Ir4gb8dnDA2iB6POvXk/qS0BYVdweOHo6LTbQ6EBvaU98gzSD0x8toNI8S3I2G2pVacbnVDWiHB+yKBdRj/41HdGpcc+i8PErUwBHOUZ3196G3m7T2jIE2CS9V2OeI2fbMOimIjaAYcDrsbSjWd8I6kqBPTpLt6ZIN/fCorvcdcsB4XNew+DmfnIQsiVz1ZPXulxghUO3m5pxTDSg7fVwy232noa0KTNPbTelTmjS2gzKxa0LISk9FNA1JIx2nyKz96Z2ZF3Rkd4z2Zuwgj1hK/+da/HXgRH7wxQASKSO582KUiNzEg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=vSDokErEW24Y+K/+FEmUkfXUYoJN/EsPto2y3M0PEqQ=; b=oleAhlwbMW4QSBhWTRALiQbxqwjVWcKS1i3N2CxyPSrum5YIT34ramEvEvYztMw8P6TH96qwR18C4nqBtbyJ7vUPbco6xHMqq44qoctUG6f1UT+JbvMx3Spoxm2ywt3BOMAEhvK6JpQJv+Pz02CFNB+BCSRRwvORDoY3oFFu9M0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB6341.eurprd04.prod.outlook.com (2603:10a6:20b:d8::14) by DB8PR04MB7067.eurprd04.prod.outlook.com (2603:10a6:10:12a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6588.31; Tue, 18 Jul 2023 09:50:55 +0000 Received: from AM6PR04MB6341.eurprd04.prod.outlook.com ([fe80::613b:e94b:4ccd:f55a]) by AM6PR04MB6341.eurprd04.prod.outlook.com ([fe80::613b:e94b:4ccd:f55a%5]) with mapi id 15.20.6588.031; Tue, 18 Jul 2023 09:50:55 +0000 From: Ming Qian To: mchehab@kernel.org, hverkuil-cisco@xs4all.nl Cc: shawnguo@kernel.org, robh+dt@kernel.org, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, xiahong.bao@nxp.com, eagle.zhou@nxp.com, tao.jiang_2@nxp.com, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 3/5] media: amphion: fix UNINIT issues reported by coverity Date: Tue, 18 Jul 2023 17:50:11 +0800 Message-Id: X-Mailer: git-send-email 2.38.1 In-Reply-To: References: X-ClientProxiedBy: SI2PR04CA0009.apcprd04.prod.outlook.com (2603:1096:4:197::8) To AM6PR04MB6341.eurprd04.prod.outlook.com (2603:10a6:20b:d8::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB6341:EE_|DB8PR04MB7067:EE_ X-MS-Office365-Filtering-Correlation-Id: 6f7116e4-3e69-4877-46cb-08db87747ad0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TgJKkiK6kC+lZ/sIRIAnrE+3V0S5l4kYoDYqc7onqdwlyse9aE5RaTVeUT/rnqtEUhcxxW72tYdKPXq8+8lG0unAmPJoErAdGtygVDAr/tt8dbBe6hba/7fmPpVRK2z9qjwIueHJ6iaNPENqf6nfcWYKLR7rJVX5E8IkccN1a7JDZj9rkKSrbD/0eOpGnynrGtfeKV2B1IhbaxpliAOumanBx/uuHTujYXl8+x8X5bisrvcNeoD361nNF5mA5XXbhHsAtwKaiHdyT8zcTH7zFccrv8gRi/cjCKKiQxgh/bcq8l78RvjzN5N7hd2bgNOqZcdl+H46bWsnCLA8AgKHbTBAXtU7Xtl9OMv4Ipy81luO6LNmvRhB92N7RfaJpvv+vqPxLZ+9mYo+OJofebCLTAMX8pK8lpOOYq8wWs8iBcp/+Q7UUm86RkPEnon0vMnUxXh/msoPBdBzENGC76yDcQ9/A6uveIjWCI8JBPw3dzXiTyB5tS2Z7KTrm9k/jPzccZb3NoyMhvFNaokymtH7OCJHgRCa3fWlcMLuNTYhw7XpnGworoxer6KS+tC3HPNiZgS8w0gng5Msb5al5Jvd7tLQ8wIf5muNtHYqQ011+LpUKw+p/oOfjVdhgxRigFWY X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB6341.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(376002)(39860400002)(136003)(346002)(396003)(451199021)(7416002)(86362001)(2906002)(36756003)(44832011)(2616005)(6512007)(83380400001)(186003)(6506007)(26005)(38350700002)(38100700002)(52116002)(6486002)(6666004)(4326008)(66946007)(66476007)(66556008)(316002)(5660300002)(478600001)(8676002)(41300700001)(8936002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: sqpti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F48AJsaKxF7UmO6bTnaOZpZ7RFYN8VdRYb2AHCGZBxUeV5sRYVBFm2cuge8jzpW/Ff2yvcs9Ya+8gV1qIkcv7qbdaqyGjpK7Q2p72X/fx7F/wmU0kShoqwiF9RFHMwWHy6H4QgMegm8giL7VFY/5tXPaC65FF52JvSe/o9RDbhzoou6uRNZj0Y+0wjRppmT/peOiYZTUNkhHqFr5aynbt3iC/Y15e2daIRpm1Uf3XtkSjESGmNPNxeRlLfcUA4NdooWeWmDeB8IrcjKKtB0RQimSCDkfWlRy6d1L/hGXrrKcgOH4jQp5S8qx1A91FCFPrEnbuecaQI9cdts/20gNQVBJXB4cFYdsEgPg9i95AAq9zlySz6VKKu/YFLNV9MpBmQUe5ZhYtxBZvidZ8bkUJXgtDzqthl0pj8Vnw8NeRzdrfwpWp27qbebO1ybJ2/86ebIHzeHXcDQxzs8KBfksOJiktbpwRg/qloVKzaR4Y4 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6f7116e4-3e69-4877-46cb-08db87747ad0 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB6341.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jul 2023 09:50:55.1908 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: UtG3ux/ERUrBDiez0CHuT8i1BSQI4L5TGCi9MLnuSdYle+SYoc6v5YOGCHNqhX3ci09tZviptaOtO8h1V0yJcw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR04MB7067 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230718_110611_265450_4D504D29 X-CRM114-Status: GOOD ( 10.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org using uninitialized value may introduce risk Fixes: 9f599f351e86 ("media: amphion: add vpu core driver") Reviewed-by: Nicolas Dufresne Signed-off-by: Ming Qian --- drivers/media/platform/amphion/vpu_msgs.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/amphion/vpu_msgs.c b/drivers/media/platform/amphion/vpu_msgs.c index f9eb488d1b5e..d0ead051f7d1 100644 --- a/drivers/media/platform/amphion/vpu_msgs.c +++ b/drivers/media/platform/amphion/vpu_msgs.c @@ -32,7 +32,7 @@ static void vpu_session_handle_start_done(struct vpu_inst *inst, struct vpu_rpc_ static void vpu_session_handle_mem_request(struct vpu_inst *inst, struct vpu_rpc_event *pkt) { - struct vpu_pkt_mem_req_data req_data; + struct vpu_pkt_mem_req_data req_data = { 0 }; vpu_iface_unpack_msg_data(inst->core, pkt, (void *)&req_data); vpu_trace(inst->dev, "[%d] %d:%d %d:%d %d:%d\n", @@ -80,7 +80,7 @@ static void vpu_session_handle_resolution_change(struct vpu_inst *inst, struct v static void vpu_session_handle_enc_frame_done(struct vpu_inst *inst, struct vpu_rpc_event *pkt) { - struct vpu_enc_pic_info info; + struct vpu_enc_pic_info info = { 0 }; vpu_iface_unpack_msg_data(inst->core, pkt, (void *)&info); dev_dbg(inst->dev, "[%d] frame id = %d, wptr = 0x%x, size = %d\n", @@ -90,7 +90,7 @@ static void vpu_session_handle_enc_frame_done(struct vpu_inst *inst, struct vpu_ static void vpu_session_handle_frame_request(struct vpu_inst *inst, struct vpu_rpc_event *pkt) { - struct vpu_fs_info fs; + struct vpu_fs_info fs = { 0 }; vpu_iface_unpack_msg_data(inst->core, pkt, &fs); call_void_vop(inst, event_notify, VPU_MSG_ID_FRAME_REQ, &fs); @@ -107,7 +107,7 @@ static void vpu_session_handle_frame_release(struct vpu_inst *inst, struct vpu_r info.type = inst->out_format.type; call_void_vop(inst, buf_done, &info); } else if (inst->core->type == VPU_CORE_TYPE_DEC) { - struct vpu_fs_info fs; + struct vpu_fs_info fs = { 0 }; vpu_iface_unpack_msg_data(inst->core, pkt, &fs); call_void_vop(inst, event_notify, VPU_MSG_ID_FRAME_RELEASE, &fs); @@ -122,7 +122,7 @@ static void vpu_session_handle_input_done(struct vpu_inst *inst, struct vpu_rpc_ static void vpu_session_handle_pic_decoded(struct vpu_inst *inst, struct vpu_rpc_event *pkt) { - struct vpu_dec_pic_info info; + struct vpu_dec_pic_info info = { 0 }; vpu_iface_unpack_msg_data(inst->core, pkt, (void *)&info); call_void_vop(inst, get_one_frame, &info); @@ -130,7 +130,7 @@ static void vpu_session_handle_pic_decoded(struct vpu_inst *inst, struct vpu_rpc static void vpu_session_handle_pic_done(struct vpu_inst *inst, struct vpu_rpc_event *pkt) { - struct vpu_dec_pic_info info; + struct vpu_dec_pic_info info = { 0 }; struct vpu_frame_info frame; memset(&frame, 0, sizeof(frame));