Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp4017588rwi; Wed, 2 Nov 2022 06:02:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM44Ekvq838GtS+7oTSypIOU1kHFiJULG0xRmnHPPDIJ7OtbGsP5HQC14Y0wkum0x2z+VbLI X-Received: by 2002:a65:6856:0:b0:46e:bcc2:8b36 with SMTP id q22-20020a656856000000b0046ebcc28b36mr21688981pgt.378.1667394144545; Wed, 02 Nov 2022 06:02:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667394144; cv=none; d=google.com; s=arc-20160816; b=k2CnvEA9hJvronALN86YQEBZ0HO5e02dwqGiCd1w++7o3/jVyRmZjBKmSKE7AdHi4V VvvtmTCDZpWMqqFHTMzb8TC2UhjBGuprUNZ8Lp/FVJotFag6RwmfuD4/pz/0Q1pjxuSU KGkjt68E0xN5tGLt9gXKE/Skc64cyNpT1aWapx+pJAdJMZh75XSCpERvZ4H2f351Gcna fnVdI4Ghf4fu916U6aHbKtn+0urHLhEEMS8wUqqpTqWBMxmu4AaABGVi5OOx0/kQio5Q 94dz/MtyDN39r9VmnMNL9JHRpfVlkEJGzldOlGElg0RylAyChfeol66TOxJyoEY05UfZ cLow== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e20-20020a056a001a9400b0056cdb20de28si18092004pfv.320.2022.11.02.06.02.03; Wed, 02 Nov 2022 06:02:24 -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 + 98 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 ); 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 To: Mauro Carvalho Chehab , Matthias Brugger Cc: Anastasia Belova , Tiffany Lin , Andrew-CT Chen , Yunfei Dong , AngeloGioacchino Del Regno , Hans Verkuil , Nicolas Dufresne , 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: X-Mailing-List: linux-kernel@vger.kernel.org Any time calling vp9_is_sf_ref_fb we need fb !=3D NULL after checks. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: f77e89854b3e ("[media] vcodec: mediatek: Add Mediatek VP9 Video De= coder Driver") Signed-off-by: Anastasia Belova --- 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 *in= st, struct vdec_fb *fb) int i; struct vdec_vp9_vsi *vsi =3D inst->vsi; =20 + if (!fb) + return true; + for (i =3D 0; i < ARRAY_SIZE(vsi->sf_ref_fb); i++) { if (fb =3D=3D &vsi->sf_ref_fb[i].fb) return true; --=20 2.30.2