Message ID | 20221112094144.4256-2-yunfei.dong@mediatek.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1194362wru; Sat, 12 Nov 2022 01:45:04 -0800 (PST) X-Google-Smtp-Source: AA0mqf5POmk/ARqjAQEvl02zD5bI1Z1jrHLHv4Um1ZyvWCJ8nVkX/lAAYngeeHXYREeabAExbNqO X-Received: by 2002:a05:6402:501a:b0:467:6b55:3cf5 with SMTP id p26-20020a056402501a00b004676b553cf5mr3930524eda.22.1668246304254; Sat, 12 Nov 2022 01:45:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668246304; cv=none; d=google.com; s=arc-20160816; b=pVAEb5ewSU2JQyHK2/j9xy/iUSEH/xDDastIBuIDd/SFhcxvegt85skAsf2NES2lTc y6o5OhSR/CdFdHIgmQ1GjhyVjk9ZD3UOXmaIQb4QITkT/LupbJQNEA6X6Cz1IKQP0iY7 FoUXRuAoZXFitH8SRp8t6/r9091a8B55dkG+lRpk7ikMXTnm7/yLO06qvoC3wgK5Rkw0 Zisf1AkJ6Hgj+sM4LxRqHSVsGTUVDjLurON/bxpuqX/XX+Op939dMbF/fI5S88e2wyOk vR5BtyGpQU/9QbTjdUCa6XL5j021TsKwfWNa266vnRKdmLFq41Aaq8GuAbiDx91akmUi /ffQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=lENu3a5A9J6wdwuret1odYFBW6/Is27YNxGGEEqEMjQ=; b=jROeWPJbgq+0ZSfMWzRoAhLbSiDihCy6PxD7lFU+wZH4C8DmhYki0Ozn6Ky/Bdsq9z G48j4H+QInHuRM9sA6DX7xdnybfg/59bLaNfOpL6rSsyklfaNd/2GBq/jKSfl7RiZ/SL KF4UHHodbKxe9KSMeWj9FBp1ZJ9KXf9gGpmiOaVCVYbECS2bhtJYpN+t2yvS7uUjUG78 lWJ31cxcfNCo/et2OxMU83Ytpgn0ejWZO3W9qOEk2ozpLHyzo3Cs5QpQpNYRqNc0k7+W fX9QTTHepAUFtJBRGVDB5G5cAFGaaBI+jM/2XmmnQwN21d3XZXXgtjDt6O93xTkpqrWG DvxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="ON/ZeKnv"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dz10-20020a0564021d4a00b00458b71488bdsi5170242edb.388.2022.11.12.01.44.40; Sat, 12 Nov 2022 01:45:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="ON/ZeKnv"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234861AbiKLJmH (ORCPT <rfc822;winker.wchi@gmail.com> + 99 others); Sat, 12 Nov 2022 04:42:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234540AbiKLJl7 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 12 Nov 2022 04:41:59 -0500 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 069741CFF3; Sat, 12 Nov 2022 01:41:54 -0800 (PST) X-UUID: 81be595ca07540328aec620b6e1e6d20-20221112 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=lENu3a5A9J6wdwuret1odYFBW6/Is27YNxGGEEqEMjQ=; b=ON/ZeKnv9G5dlXrHM8zRx6cIvZ2WPGTywjpRan1BnKie02/KYfd33q7KcV63GzLuA5SXwXSjVF7jHdFouJomEvQ/BrA/7RtPBlG/UtwPUgp7ZV4hQkrSWphfAOuTJDntl70b8PFZWptyYT606ES3ablyAD+R0/lI8NKoVgAn7Vg=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.13,REQID:9c39ae5b-83bd-458b-bc1b-68e87e374f92,IP:0,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-5 X-CID-META: VersionHash:d12e911,CLOUDID:a0e71286-088c-4756-8f76-577be701e693,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: 81be595ca07540328aec620b6e1e6d20-20221112 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw01.mediatek.com (envelope-from <yunfei.dong@mediatek.com>) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 742630741; Sat, 12 Nov 2022 17:41:49 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by mtkmbs13n1.mediatek.inc (172.21.101.193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.15; Sat, 12 Nov 2022 17:41:47 +0800 Received: from localhost.localdomain (10.17.3.154) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Sat, 12 Nov 2022 17:41:46 +0800 From: Yunfei Dong <yunfei.dong@mediatek.com> To: Yunfei Dong <yunfei.dong@mediatek.com>, Chen-Yu Tsai <wenst@chromium.org>, Nicolas Dufresne <nicolas@ndufresne.ca>, Hans Verkuil <hverkuil-cisco@xs4all.nl>, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, Benjamin Gaignard <benjamin.gaignard@collabora.com>, Tiffany Lin <tiffany.lin@mediatek.com> CC: Mauro Carvalho Chehab <mchehab@kernel.org>, Matthias Brugger <matthias.bgg@gmail.com>, George Sun <george.sun@mediatek.com>, Xiaoyong Lu <xiaoyong.lu@mediatek.com>, Hsin-Yi Wang <hsinyi@chromium.org>, Fritz Koenig <frkoenig@chromium.org>, Daniel Vetter <daniel@ffwll.ch>, Steve Cho <stevecho@chromium.org>, <linux-media@vger.kernel.org>, <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>, <linux-mediatek@lists.infradead.org>, <Project_Global_Chrome_Upstream_Group@mediatek.com> Subject: [PATCH 1/5] media: mediatek: vcodec: Fix getting NULL pointer for dst buffer Date: Sat, 12 Nov 2022 17:41:40 +0800 Message-ID: <20221112094144.4256-2-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221112094144.4256-1-yunfei.dong@mediatek.com> References: <20221112094144.4256-1-yunfei.dong@mediatek.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, T_SPF_TEMPERROR,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749283036447180975?= X-GMAIL-MSGID: =?utf-8?q?1749283036447180975?= |
Series |
media: mediatek: vcodec: Fix decode random crash for PLT test
|
|
Commit Message
Yunfei Dong (董云飞)
Nov. 12, 2022, 9:41 a.m. UTC
The driver may can't get v4l2 buffer when lat or core decode timeout,
will lead to crash when call v4l2_m2m_buf_done to set dst buffer
(NULL pointer) done.
Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
---
.../mediatek/vcodec/mtk_vcodec_dec_stateless.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
Comments
Il 12/11/22 10:41, Yunfei Dong ha scritto: > The driver may can't get v4l2 buffer when lat or core decode timeout, > will lead to crash when call v4l2_m2m_buf_done to set dst buffer > (NULL pointer) done. > > Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com> This commit needs a Fixes tag. Regards, Angelo
diff --git a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_stateless.c b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_stateless.c index c45bd2599bb2..e86809052a9f 100644 --- a/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_stateless.c +++ b/drivers/media/platform/mediatek/vcodec/mtk_vcodec_dec_stateless.c @@ -138,10 +138,13 @@ static void mtk_vdec_stateless_cap_to_disp(struct mtk_vcodec_ctx *ctx, int error state = VB2_BUF_STATE_DONE; vb2_dst = v4l2_m2m_dst_buf_remove(ctx->m2m_ctx); - v4l2_m2m_buf_done(vb2_dst, state); - - mtk_v4l2_debug(2, "free frame buffer id:%d to done list", - vb2_dst->vb2_buf.index); + if (vb2_dst) { + v4l2_m2m_buf_done(vb2_dst, state); + mtk_v4l2_debug(2, "free frame buffer id:%d to done list", + vb2_dst->vb2_buf.index); + } else { + mtk_v4l2_err("dst buffer is NULL"); + } if (src_buf_req) v4l2_ctrl_request_complete(src_buf_req, &ctx->ctrl_hdl);