Message ID | 20221102121027.4285-1-abelova@astralinux.ru |
---|---|
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 l7csp3582582wru; Wed, 2 Nov 2022 05:16:57 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7dqHb/D+rKmhNN3HkQ0sQi7A87enf1Q+gLksTcWwNrY+FjAox2tAC830Jb2e6zKzfml4xZ X-Received: by 2002:a63:cc4a:0:b0:439:1c48:2fed with SMTP id q10-20020a63cc4a000000b004391c482fedmr21809028pgi.618.1667391417501; Wed, 02 Nov 2022 05:16:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667391417; cv=none; d=google.com; s=arc-20160816; b=nzIbuCxpkZMfaS6DdyRjbltnin3b7zD4Ggr5p0S4kg+fMZzVmtwEltCKpOZKVIq6Rq oFTR0veYQ03xVx1WEemf6hA4ZdZjP5eOL5yErsJDqLw9pRKUItWZhcp+h2+C0uD0E96m jnkKFKs2dY/r6v/yC1R601NdN2t10OuMpvCXjXqDzBTk0xYW3MVz6BQ6GC3UvdisKr/6 A6gJZV7TLd/yHR8/iXiLq9zY2qf8/uamyBN/JoFA1DMzSxCZ9WEB8ByRRayUfsUyZkAv gI2LW+juacW00SEyU6xjGHEan0+00S1Z8rdelhC9dAZ7xdIlLVwwGunXfuQVEDnTWkBa d7Xw== 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; bh=XIwwONpUR9SdSPR3A4IDAkq7FO9Vi6bAN02Uo080t4Q=; b=mz/btZ75iksOvZ6mNSkoVHxuaDzJvGlzMOmCXqN9RMIkJfVO5vx4uJSEvAUfPCD4IT G2+VoCXUhs2ieISIEZdoyTzsBuXdei8J2iXj1b9YLMpyjfRwMa7pPWSP+VEJxuUWAz9d oIeXvVgQKzyyhFUp+V8HdJyy1cdhTfH36VZZ2BefebrUMTsUC2MEgWlUV47+RYwBKKzz pV60el+3ZcsD0f6lf1spizLZHoNXgOtoNzG64ERuUSuRIjDGe3fOh+dSFYi4koe015CE l6P82oPXK4/3Yl9F/kAuubKD5zVl4/SvHqhzZxxg7crO+H+vkf6IiM7lyS9mgYwXnhIf 94vw== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nn3-20020a17090b38c300b0020382775a6fsi2429371pjb.149.2022.11.02.05.16.43; Wed, 02 Nov 2022 05:16:57 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230274AbiKBMKu (ORCPT <rfc822;billy.jones8454@gmail.com> + 99 others); Wed, 2 Nov 2022 08:10:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230098AbiKBMKq (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 2 Nov 2022 08:10:46 -0400 Received: from mail.astralinux.ru (mail.astralinux.ru [217.74.38.119]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D00523151; Wed, 2 Nov 2022 05:10:40 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by mail.astralinux.ru (Postfix) with ESMTP id 240631864286; Wed, 2 Nov 2022 15:10:37 +0300 (MSK) Received: from mail.astralinux.ru ([127.0.0.1]) by localhost (rbta-msk-vsrv-mail01.astralinux.ru [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id x3qXL0O3_M-d; Wed, 2 Nov 2022 15:10:36 +0300 (MSK) Received: from localhost (localhost [127.0.0.1]) by mail.astralinux.ru (Postfix) with ESMTP id C9B7A1864285; Wed, 2 Nov 2022 15:10:36 +0300 (MSK) X-Virus-Scanned: amavisd-new at astralinux.ru Received: from mail.astralinux.ru ([127.0.0.1]) by localhost (rbta-msk-vsrv-mail01.astralinux.ru [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id OhcNLsfn8h1N; Wed, 2 Nov 2022 15:10:36 +0300 (MSK) Received: from rbta-msk-lt-106062.astralinux.ru (unknown [10.177.20.20]) by mail.astralinux.ru (Postfix) with ESMTPSA id 1483F1864280; Wed, 2 Nov 2022 15:10:36 +0300 (MSK) From: Anastasia Belova <abelova@astralinux.ru> To: Mauro Carvalho Chehab <mchehab@kernel.org>, Matthias Brugger <matthias.bgg@gmail.com> Cc: Anastasia Belova <abelova@astralinux.ru>, Tiffany Lin <tiffany.lin@mediatek.com>, Andrew-CT Chen <andrew-ct.chen@mediatek.com>, Yunfei Dong <yunfei.dong@mediatek.com>, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, Hans Verkuil <hverkuil-cisco@xs4all.nl>, Nicolas Dufresne <nicolas.dufresne@collabora.com>, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, lvc-project@linuxtesting.org Subject: [PATCH v2] vcodec: mediatek: add check for NULL for Date: Wed, 2 Nov 2022 15:10:27 +0300 Message-Id: <20221102121027.4285-1-abelova@astralinux.ru> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS 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?1748386622873523250?= X-GMAIL-MSGID: =?utf-8?q?1748386622873523250?= |
Series |
[v2] vcodec: mediatek: add check for NULL for
|
|
Commit Message
Anastasia Belova
Nov. 2, 2022, 12:10 p.m. UTC
Any time calling vp9_is_sf_ref_fb we need fb != NULL after checks.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: f77e89854b3e ("[media] vcodec: mediatek: Add Mediatek VP9 Video Decoder Driver")
Signed-off-by: Anastasia Belova <abelova@astralinux.ru>
---
drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_if.c | 3 +++
1 file changed, 3 insertions(+)
Comments
Le mercredi 02 novembre 2022 à 15:10 +0300, Anastasia Belova a écrit : > Any time calling vp9_is_sf_ref_fb we need fb != NULL after checks. > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Fixes: f77e89854b3e ("[media] vcodec: mediatek: Add Mediatek VP9 Video Decoder Driver") As Angelo said, this change is a no-op in practice, for this reason I would suggest to drop the `Fixes` tag (not worth the effort of back-porting this). > > Signed-off-by: Anastasia Belova <abelova@astralinux.ru> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> > --- > drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_if.c | 3 +++ > 1 file changed, 3 insertions(+) > > 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..776468cd834a 100644 > --- a/drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_if.c > +++ b/drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_if.c > @@ -208,6 +208,9 @@ static bool vp9_is_sf_ref_fb(struct vdec_vp9_inst *inst, struct vdec_fb *fb) > int i; > struct vdec_vp9_vsi *vsi = inst->vsi; > > + if (!fb) > + return true; > + > for (i = 0; i < ARRAY_SIZE(vsi->sf_ref_fb); i++) { > if (fb == &vsi->sf_ref_fb[i].fb) > return true;
Il 02/11/22 13:10, Anastasia Belova ha scritto: > Any time calling vp9_is_sf_ref_fb we need fb != NULL after checks. > > Found by Linux Verification Center (linuxtesting.org) with SVACE. > > Fixes: f77e89854b3e ("[media] vcodec: mediatek: Add Mediatek VP9 Video Decoder Driver") > > Signed-off-by: Anastasia Belova <abelova@astralinux.ru> Hello Anastasia, for some reason, you've got an incomplete commit title on this v2. Please fix. Thanks, Angelo
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..776468cd834a 100644 --- a/drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_if.c +++ b/drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_if.c @@ -208,6 +208,9 @@ static bool vp9_is_sf_ref_fb(struct vdec_vp9_inst *inst, struct vdec_fb *fb) int i; struct vdec_vp9_vsi *vsi = inst->vsi; + if (!fb) + return true; + for (i = 0; i < ARRAY_SIZE(vsi->sf_ref_fb); i++) { if (fb == &vsi->sf_ref_fb[i].fb) return true;