From patchwork Mon Mar 8 10:52:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanimir Varbanov X-Patchwork-Id: 395380 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1600698jai; Mon, 8 Mar 2021 02:53:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJwS6JukabBaibi9IO0dMawwGhn+TOtogmVrcWgAHfIkBzmaZJGi9eMS12SnJ8YNtTlI2i9A X-Received: by 2002:aa7:d686:: with SMTP id d6mr21948597edr.146.1615200789465; Mon, 08 Mar 2021 02:53:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615200789; cv=none; d=google.com; s=arc-20160816; b=G581rNIHr6UubrlJtEfkwMCxP2etOnRbv7aRq5EVi43H3s+lthY3cztNdPTS/bIeO0 T4hYCWJ2zK2osM/8wmPBVrmrvK6GIzOr+f4p0yM7NI8JACm+KZQ/vu3Y+KYAOzvrtPPS VW8pdTKrE+RFDR87J9u07xualz7/BajhNZasWfmsW3Oz5qqk2uMq8kR8LI9a/qWIAW0N 6xtMvQHoz4ngCzH0GLA1JuFEyInTH8oRmPdUKrR0u88JdbeMxzOiIEPMhXUdCKU2fT0J ChlGaXCuRxped7iyuNoxKCsc7EyyyiDs3qoLiAqPw7Ptj49kiSA758PyHsLdNA0rWZ+R oyLw== 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=Nu5tkdFsaHazmRd4/55M771FR4RELHyaxuVaBLaaiaE=; b=cYlcW7LmiKU2AlHOjiikL+UZg0WtrhnhjPxeadUCnA6XWL0GQdVAvkMPQFM5ZcRyJW 2pJtRhbRqn6hFJ+7Bqj2vNZrsMnqeEgkPuxZQB5Pcdzngxv51YVzH2LpImDQbnSEPXbZ mQex6b7HaFTyujNMeHptOF5tIh98PZXz8+KS3a0Jp2bWVNr/KIjfhAIeCw2qzGX/4vRK mp/YBizP7ZLGRelcWdytKEEgs/kkuzUqmhqmksItAJr9WjxQ9vbWLTHpCOKReK+izgZK 41PH2OgqOXmc04I5/Jo+NJLQDk+LOdxa7G/D7592e4VQSgUbt0EhulqlzuVkuRyGdzCg x0ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nPiYOkvq; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a4si6492505ejy.263.2021.03.08.02.53.09; Mon, 08 Mar 2021 02:53:09 -0800 (PST) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nPiYOkvq; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231220AbhCHKwg (ORCPT + 13 others); Mon, 8 Mar 2021 05:52:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230522AbhCHKw0 (ORCPT ); Mon, 8 Mar 2021 05:52:26 -0500 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F8B2C061761 for ; Mon, 8 Mar 2021 02:52:26 -0800 (PST) Received: by mail-ed1-x529.google.com with SMTP id bd6so13931824edb.10 for ; Mon, 08 Mar 2021 02:52:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Nu5tkdFsaHazmRd4/55M771FR4RELHyaxuVaBLaaiaE=; b=nPiYOkvqpxOFvenVXbshjw+7ue8UcdngITP3Sc2q0OMxuvLvE1iLAgDD0kEXI1Oi2X iVoxHCNlKRcZ1UDTmVoy1EddhAVFAXQp7fDPOHnQ5rVwN4uOtw0Ios0vhPRiioS4LjDT UQT7+jt3RP9nIau/UNZKAey75BzkItjF/yEYXERQWRE34VICWmsEGMjSlS5MQkPrANDz zl47MnYwfHTb2utiHgCFg/PxM7bfqBuUp/VF1/Nb1zVPQf5prUFWFooMVBpEC5U07K07 Ic0wQxw9y7463ThW4pGK2htYBvJ/foc/0VtJM+z35a0/EVsfiiQ5CPeMVL69WjVW1B6Y K8EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Nu5tkdFsaHazmRd4/55M771FR4RELHyaxuVaBLaaiaE=; b=sqUp2Xi9yXsCkJIsKFPRoAxBa6HQXnkAdCjHaa6GmxCURAQqDHuJeisvvFDkuZMPuS cDctH8t72cxplxdaBp4Cm+By3bJUJQa1MBJ4Nk37qtF47CnUeHfyOdo/Cp3nEBKiJYLs Upg9fWdyi9mVENMH43y67BNk3/jcXq06tlbCl3KE1GlQqY8qSXcRU1q+j4ix57OX7bLI Vq1YhvxYCFkAPJnFIOkI6n4sVU5C8ejhULUMNkAMZJk0khJDgUFuZx62Ur+Rw2Y50ixU leP4m5fj9MkmRBFj+jiIHTho65sz1Z54B/EfqiMwskcsZWBBnofSKwj1d8jW1DqaaKr1 wDxg== X-Gm-Message-State: AOAM531RllmNZoakIki3bANk8s3/xuowWd6zpmUPDn6QDeaTKwgsUN8w dHbDQmOQevD6H5rs9xIpbNMCUw== X-Received: by 2002:aa7:cb8f:: with SMTP id r15mr21684254edt.130.1615200744772; Mon, 08 Mar 2021 02:52:24 -0800 (PST) Received: from localhost.localdomain (95-43-196-84.ip.btc-net.bg. [95.43.196.84]) by smtp.gmail.com with ESMTPSA id y9sm6386297ejd.110.2021.03.08.02.52.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Mar 2021 02:52:24 -0800 (PST) From: Stanimir Varbanov To: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: bryan.odonoghue@linaro.org, Stanimir Varbanov , stable@vger.kernel.org Subject: [PATCH 2/5] venus: hfi_parser: Check for instance after hfi platform get Date: Mon, 8 Mar 2021 12:52:02 +0200 Message-Id: <20210308105205.445148-3-stanimir.varbanov@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210308105205.445148-1-stanimir.varbanov@linaro.org> References: <20210308105205.445148-1-stanimir.varbanov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The inst function argument is != NULL only for Venus v1 and we did not migrate v1 to a hfi_platform abstraction yet. So check for instance != NULL only after hfi_platform_get returns no error. Fixes: e29929266be1 ("media: venus: Get codecs and capabilities from hfi platform") Cc: stable@vger.kernel.org # v5.12+ Signed-off-by: Stanimir Varbanov --- drivers/media/platform/qcom/venus/hfi_parser.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.25.1 diff --git a/drivers/media/platform/qcom/venus/hfi_parser.c b/drivers/media/platform/qcom/venus/hfi_parser.c index ce230974761d..5b8389b98299 100644 --- a/drivers/media/platform/qcom/venus/hfi_parser.c +++ b/drivers/media/platform/qcom/venus/hfi_parser.c @@ -235,13 +235,13 @@ static int hfi_platform_parser(struct venus_core *core, struct venus_inst *inst) u32 enc_codecs, dec_codecs, count = 0; unsigned int entries; - if (inst) - return 0; - plat = hfi_platform_get(core->res->hfi_version); if (!plat) return -EINVAL; + if (inst) + return 0; + if (plat->codecs) plat->codecs(&enc_codecs, &dec_codecs, &count);