Message ID | 20230705091441.16926-1-irui.wang@mediatek.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp1741734vqx; Wed, 5 Jul 2023 02:33:23 -0700 (PDT) X-Google-Smtp-Source: APBJJlFDwJ3E4Kw8W/uv7K2Rd2wg8oQJx6fQV/+6W4aoNIMQ1HHXrOr0hxqDvF1CCdSLdXqiPYsY X-Received: by 2002:a17:903:120c:b0:1b8:2132:a7fd with SMTP id l12-20020a170903120c00b001b82132a7fdmr13338472plh.13.1688549603357; Wed, 05 Jul 2023 02:33:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688549603; cv=none; d=google.com; s=arc-20160816; b=av0y9a/BZvg/etEGASj1j4XFXdJ50nTyJV4K5FQ8Tg/RFH9cBXfQ6WzYVbob+4Ffi6 D8QcTLTRWMIJ0IZuRj5kFDgnZwHSZTYHORIJ/ZjG1rCwymHhf/LUsIAYxmeAVGmHLUX6 gSh2sZ5z2JVc5n7T2OwSw86FHIQiZpiMzxU5C4vinMQMwdfgOkFsD4D4avzOxZa0UbaT w/ZtpfQRS4YOwfmvGGg3Jk+hmKxLHSjfb09qCFUptJiARz1mLs80nol939FBj1QDZo1W 8py3k2UxXTXEZXTjWoHXtbDwlUxB1Ikjx8Us1zyV9ELJ0xzqKL6KsL9mOOR+Vf9HlZIV Fmvw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=se64KQH3gerKnz6HlAf5ClGc47AESPwNkTnbl8HVi8g=; fh=qQ4nc25opjVC1dlktl0ecFk7WD1j++Po28M3kjRjg48=; b=Q08DMA9bec40U0gjegDCxYnZk9+RSsvdE4JGfJw3pvAUCTjlpxhWmq2GWJ0oG7AsG0 qCiyipfkSuB9AB7r8zz4WZ7EeiYahJhxrZmrRH1/POlqyG5L18RnzqMzRQ9rx4Jg/OPD JCXhPL7sbkO6OLOMulFOQTfF4l0bTKoZUklpcWd8cmHIk4uaiYLISEYnyr7DIGwTIcxb sEYLHYYlwR6Gh9Gs8PCEoh+2O2LHTpPi6PDdsoXC/sBtXIPByBACx5TlfL1roUwDC7M6 tflzlfscfhUZEwDHvBFFIx0R0qOS861Fi0j0Y2aoM2KyJ3R4SCiqHSHAwtb6kDnOAvEx Uc/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=YWQ9JoRB; 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 x2-20020a170902ec8200b001b8690d7181si12090143plg.550.2023.07.05.02.33.06; Wed, 05 Jul 2023 02:33:23 -0700 (PDT) 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=YWQ9JoRB; 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 S232166AbjGEJOv (ORCPT <rfc822;tebrre53rla2o@gmail.com> + 99 others); Wed, 5 Jul 2023 05:14:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231835AbjGEJOu (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 5 Jul 2023 05:14:50 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 291B6170E; Wed, 5 Jul 2023 02:14:48 -0700 (PDT) X-UUID: 624d5c481b1411eeb20a276fd37b9834-20230705 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:Message-ID:Date:Subject:CC:To:From; bh=se64KQH3gerKnz6HlAf5ClGc47AESPwNkTnbl8HVi8g=; b=YWQ9JoRBZdmLS8nv8rYO9ZB9EVD+SYsX2BcYHf4nkYU2GluDUlUYHr6yAIAG6FH6MfsCpXNen8gd1SwBabFJssrI94NS/zcDxKj3BuidFVDFzStHUQqpUTBHl2tY6t2hfNrD2uh2eog7aHTdBaiqEHQPh4lsSfz3Sh88UDzZCaU=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.27,REQID:3d7cc2ba-6825-4123-9d4f-883b66da2534,IP:0,U RL:0,TC:0,Content:0,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION: release,TS:0 X-CID-META: VersionHash:01c9525,CLOUDID:b853b982-5a99-42ae-a2dd-e4afb731b474,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:11|1,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR: NO X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_ULN X-UUID: 624d5c481b1411eeb20a276fd37b9834-20230705 Received: from mtkmbs10n2.mediatek.inc [(172.21.101.183)] by mailgw02.mediatek.com (envelope-from <irui.wang@mediatek.com>) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 606305702; Wed, 05 Jul 2023 17:14:45 +0800 Received: from mtkmbs13n2.mediatek.inc (172.21.101.108) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Wed, 5 Jul 2023 17:14:44 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs13n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Wed, 5 Jul 2023 17:14:43 +0800 From: Irui Wang <irui.wang@mediatek.com> To: Hans Verkuil <hverkuil-cisco@xs4all.nl>, Mauro Carvalho Chehab <mchehab@kernel.org>, Matthias Brugger <matthias.bgg@gmail.com>, <angelogioacchino.delregno@collabora.com> CC: Tiffany Lin <tiffany.lin@mediatek.com>, Yunfei Dong <yunfei.dong@mediatek.com>, Maoguang Meng <maoguang.meng@mediatek.com>, "Irui Wang" <irui.wang@mediatek.com>, <Project_Global_Chrome_Upstream_Group@mediatek.com>, <linux-media@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>, <linux-mediatek@lists.infradead.org> Subject: [PATCH v3] media: mediatek: vcodec: Return NULL if no vdec_fb is found Date: Wed, 5 Jul 2023 17:14:41 +0800 Message-ID: <20230705091441.16926-1-irui.wang@mediatek.com> X-Mailer: git-send-email 2.25.1 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,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,URIBL_BLOCKED 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?1770572194600191428?= X-GMAIL-MSGID: =?utf-8?q?1770572588860108121?= |
Series |
[v3] media: mediatek: vcodec: Return NULL if no vdec_fb is found
|
|
Commit Message
Irui Wang (王瑞)
July 5, 2023, 9:14 a.m. UTC
"fb_use_list" is used to store used or referenced frame buffers for
vp9 stateful decoder. "NULL" should be returned when getting target
frame buffer failed from "fb_use_list", not a random unexpected one.
Fixes: f77e89854b3e ("[media] vcodec: mediatek: Add Mediatek VP9 Video Decoder Driver")
Signed-off-by: Irui Wang <irui.wang@mediatek.com>
---
changed with v2:
- add Fixes tag.
changed with v1:
- remove the added flag variable.
- updata commit message.
---
drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_if.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_if.c b/drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_if.c index 70b8383f7c8e..a27a109d8d14 100644 --- a/drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_if.c +++ b/drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_if.c @@ -226,10 +226,11 @@ static struct vdec_fb *vp9_rm_from_fb_use_list(struct vdec_vp9_inst if (fb->base_y.va == addr) { list_move_tail(&node->list, &inst->available_fb_node_list); - break; + return fb; } } - return fb; + + return NULL; } static void vp9_add_to_fb_free_list(struct vdec_vp9_inst *inst,