From patchwork Mon Sep 13 13:13:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 509765 Delivered-To: patch@linaro.org Received: by 2002:a02:c816:0:0:0:0:0 with SMTP id p22csp614790jao; Mon, 13 Sep 2021 07:31:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzlOf5WfIYI5R35zWs4e9tVSHgcnr+HlKgK70WnWPqXM4oQjnFLA9hmuzTlwslyjNzDjT2k X-Received: by 2002:a05:6602:22da:: with SMTP id e26mr8798735ioe.88.1631543495476; Mon, 13 Sep 2021 07:31:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631543495; cv=none; d=google.com; s=arc-20160816; b=VMGTrohjfpb/9JjrGjE0B1CwiuUrFq82/1kE8GbRrhMRURdFPWUrM6w4n4jlTUnzhX 77F2i+oOuiLJWWV+pZjcwrL3MlXX+8l9/NiFLN7APy59mDFxBLl3bhEAkeizVf/jzRrF gaVlLjvh9M9eK6QmusJAwgafhaYXQKICFYlJ7jHSZwso0H5QEFHCG9Ra21GIP2noWBgy JYgO44BDF3qV2Ghh8VpVtZMkJxlyjxbzfZ6a2A+GH65ySuPgoyHCbQmlJ7akpQmwkuFd oQbhMyTYLkdLG5eHP+uAnS6aoouA/bNxx0CqxAoccb793J4vL0YNGPb8Z79lHuG0ud2A Fjpg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=utbVCo9t4ZZVNxaVMJGUPKaRTfhsCeOEdBsVRC+iuJI=; b=R2TBuVPp2oG6FLnKK0YXTUeU/yEN38/IpTgHQj/NinTRFBGFnPYlf8n2nb+bIbKl+X gW7bVhjfkC8K+wHyp4yMs2xpy4VXIzBH9ImRLQu7aSop51cvJGPSLeNZ3PNPiUb9pDFp Nn2k7i1KHlljfKpz1FQs1haoL3HF+UB68NuBhv8d7fmRZQtdohUp9XsyEexMahMuKdQL F0lP/UI2OWa5JenQAv5HBfQtQhGwSCtdEay2SxybXKx+L1lIlJ2I3NjrnONZgh1HZsDv kWc4hF3ttcS/Bqc/+FsWD0+IF5kUurp4Td3KmxpDo4eHoGlh/Np2L/+9QNnZdwSsH4xd Lnag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=X6ZkhZfQ; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y10si6043252ion.41.2021.09.13.07.31.35; Mon, 13 Sep 2021 07:31:35 -0700 (PDT) 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=@linuxfoundation.org header.s=korg header.b=X6ZkhZfQ; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346412AbhIMOct (ORCPT + 11 others); Mon, 13 Sep 2021 10:32:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:51038 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245472AbhIMOaz (ORCPT ); Mon, 13 Sep 2021 10:30:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8DB0C60E08; Mon, 13 Sep 2021 13:51:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1631541100; bh=U/V0Muk/z2AxBNZ6AZLVKCfwt65va+Gefob8QAAvJRw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=X6ZkhZfQZLLULbCcsHYj8q8R0k/PpVIryfEmzOW1fmGOF/Rs4T6Kv6RFxtAvSZKU8 5y6vW/dPAaYIOUPUgNVvlQ2arnZ2xkmjzszLaRmxpdFdau8+6zUjlfwi96AbFAF9tN rFj1l3gj3G8T47ap1si/OyFOKw9Ff1aNJyISnXT8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Zhen Lei , Stanimir Varbanov , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 5.14 161/334] media: venus: hfi: fix return value check in sys_get_prop_image_version() Date: Mon, 13 Sep 2021 15:13:35 +0200 Message-Id: <20210913131118.792169763@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913131113.390368911@linuxfoundation.org> References: <20210913131113.390368911@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Zhen Lei [ Upstream commit 331e06bbde5856059b7a6bb183f12878ed4decb1 ] In case of error, the function qcom_smem_get() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: d566e78dd6af ("media: venus : hfi: add venus image info into smem") Reported-by: Hulk Robot Signed-off-by: Zhen Lei Signed-off-by: Stanimir Varbanov Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/qcom/venus/hfi_msgs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.30.2 diff --git a/drivers/media/platform/qcom/venus/hfi_msgs.c b/drivers/media/platform/qcom/venus/hfi_msgs.c index d9fde66f6fa8..9a2bdb002edc 100644 --- a/drivers/media/platform/qcom/venus/hfi_msgs.c +++ b/drivers/media/platform/qcom/venus/hfi_msgs.c @@ -261,7 +261,7 @@ sys_get_prop_image_version(struct device *dev, smem_tbl_ptr = qcom_smem_get(QCOM_SMEM_HOST_ANY, SMEM_IMG_VER_TBL, &smem_blk_sz); - if (smem_tbl_ptr && smem_blk_sz >= SMEM_IMG_OFFSET_VENUS + VER_STR_SZ) + if (!IS_ERR(smem_tbl_ptr) && smem_blk_sz >= SMEM_IMG_OFFSET_VENUS + VER_STR_SZ) memcpy(smem_tbl_ptr + SMEM_IMG_OFFSET_VENUS, img_ver, VER_STR_SZ); }