Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3695917iog; Tue, 28 Jun 2022 00:15:36 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vXwap6cJ3hVWkyxbUylWs8XQx7X/o9CtKlclC5GpoJ+4Xsy6xkfsdArshXyxMF3bDMJ6bc X-Received: by 2002:a17:906:dc8f:b0:725:28d1:422d with SMTP id cs15-20020a170906dc8f00b0072528d1422dmr16104004ejc.131.1656400536668; Tue, 28 Jun 2022 00:15:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656400536; cv=none; d=google.com; s=arc-20160816; b=Y2OJjxO7/IdKERba4+MftMkhb4bgQb4gkCueOJptRlBTpklYXF1Mxe7JPvoDdhoDe4 /DzNJy2DZ09k24vAAl26r8mChRsYAcB2YVLnZvCA2ueBjSpGvpPHZITCtwsNGgljetcV aPEaJkJluTR6HcAnxjBrC+mqI4feiQT4rQSk7Bt6rRF9/3aC35VexCmEwHXFNZyghiHz cCwcj8s5wnE494U1KWwMYIq9leGoqpbYimzp64uHykmTzUpd6Tu3355DENUb/FHdyG0o hi3IH7MFoOEwm+uwQVxL13ePGkRBOvgTyA3G7F3h+O7pTRkFozkWIRN6wS+w/VXaq5IF c2RA== 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=fkiaam1EyHuqvFSKCW0q/+0Nn80yykZPuCIRdoOoPaU=; b=SMQvUThgQnk3n3DGVxqpID/FmbRB1TrWgCFaHhvHCQ3NeB1xkG4P+rgVEqEpVJvLPg G0OwsEzwlxd08g9TXFB9bS5zr/5bndrsgLJ+Z7qnwo6o3xOSDTFPsmdX6BIVAjW2yikW SeiAod+IESavDE+ZjmmLyBF3ZnqJ9hcowfY9FILRDGk13qh4aebSFvyCdhlYAs+OnLCb 7f4XzkhaG/+/h83AKaj/51aY+gS1kk3WHdsD8cZjdKNPRrplN2Xtz0RSCEKElzQCNbUF 7DTBzEz2CManlsAfb4g+c4G7n0KkUzFww2ggcywi3FqC3q6zCuGq2eWQl7S+AAv/v3Vg 9u6A== 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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h3-20020a056402280300b00435bb0732fesi3091558ede.234.2022.06.28.00.15.04; Tue, 28 Jun 2022 00:15:36 -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; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343624AbiF1Gmv (ORCPT + 99 others); Tue, 28 Jun 2022 02:42:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343544AbiF1Gm1 (ORCPT ); Tue, 28 Jun 2022 02:42:27 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 583F12654D for ; Mon, 27 Jun 2022 23:42:26 -0700 (PDT) Received: from dggpemm500020.china.huawei.com (unknown [172.30.72.53]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4LXFL63WMrzTgDh; Tue, 28 Jun 2022 14:38:54 +0800 (CST) Received: from dggpemm500007.china.huawei.com (7.185.36.183) by dggpemm500020.china.huawei.com (7.185.36.49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 28 Jun 2022 14:42:23 +0800 Received: from huawei.com (10.175.103.91) by dggpemm500007.china.huawei.com (7.185.36.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 28 Jun 2022 14:42:23 +0800 From: Yang Yingliang To: , CC: , Subject: [PATCH] optee: smc_abi.c: fix wrong pointer passed to IS_ERR/PTR_ERR() Date: Tue, 28 Jun 2022 14:52:16 +0800 Message-ID: <20220628065216.901194-1-yangyingliang@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.103.91] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To dggpemm500007.china.huawei.com (7.185.36.183) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 It should be 'rpc_arg' pass to IS_ERR/PTR_ERR(). Fixes: ed8faf6c8f8c ("optee: add OPTEE_SMC_CALL_WITH_RPC_ARG and OPTEE_SMC_CALL_WITH_REGD_ARG") Reported-by: Hulk Robot Signed-off-by: Yang Yingliang --- drivers/tee/optee/smc_abi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/tee/optee/smc_abi.c b/drivers/tee/optee/smc_abi.c index 385cb0aee610..a1c1fa1a9c28 100644 --- a/drivers/tee/optee/smc_abi.c +++ b/drivers/tee/optee/smc_abi.c @@ -884,8 +884,8 @@ static int optee_smc_do_call_with_arg(struct tee_context *ctx, rpc_arg_offs = OPTEE_MSG_GET_ARG_SIZE(arg->num_params); rpc_arg = tee_shm_get_va(shm, offs + rpc_arg_offs); - if (IS_ERR(arg)) - return PTR_ERR(arg); + if (IS_ERR(rpc_arg)) + return PTR_ERR(rpc_arg); } if (rpc_arg && tee_shm_is_dynamic(shm)) { -- 2.25.1