Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp478661rwr; Thu, 4 May 2023 23:31:42 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4hxTqbvEY4ibuJ7ZJdD/2rUi3YIyroJt7Zwqm0wZWTb3WLe9Vn4gQwKDujF8JNPyrX7cn3 X-Received: by 2002:a05:6a00:84b:b0:643:cb0:2bbe with SMTP id q11-20020a056a00084b00b006430cb02bbemr1109003pfk.15.1683268302284; Thu, 04 May 2023 23:31:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683268302; cv=none; d=google.com; s=arc-20160816; b=NdRxob9OTy3m2gPj8Ja7XrYzncPerbKuR65tIKKcs3UomuivYN8MhCVq0WqDBrNXzQ Psb0GbLQrtMBF4mvscAS03kPbdywN94r1MYZBKx+L1us05HoFsUii4Gtiezje9e+XxlF ufI4joI/nXHLfrXXFRuIFL5fBSkEt8pfO3yvkve4qg+K7khwaggEmz9nr+5V2VkDXIl8 5uNrNuf3gkblZwtzFwOtmS7zhrZ5x5yhoN7BZlQA/cQb+QBsDApjZlhidnG9UkfJZXdO ekFBtVSa2Yh+hFw4GV9kPKKVp+fcJotYUCrMIyzpXFNyWU7JmAiLHInSp3IT0ZT92z/R TgUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:mime-version:message-id:date; bh=/GB40gkG2PwvyP6DUG7nrkSV0OkHNuRTKuLsv24c1y8=; b=CbK6Rz1ymvMOrahQkaztZ3248TAPxdsqoPENGgSUy/rvvmBkILh+erD67BPCNwA/xH amJ9ve78EBzRpYHUPuSk9cwzn1IXkLwGV6H2NZ6AEeyA89zKXhY7k9Dck6gbzeuQjqdc NjXyfxYgQDwGrGonBxiaUjdx6k3hSHJaUqBvBhq2FuDNOgjpgTNGyLgmZ6v/ldeR/EEA 3sMQAU3ojUlQZ4ePAANlNNVliFeyLZLNoa100bo8L4UQ0WsjE6/9Sadz7c5mTc/274bD kWGfPc/qjd7hG3vepJotxx7Za4wo3KdI+hTiGvjDjg2bqbc8OqIi9U6o6493iJYNeWYH nyfA== 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=NONE sp=NONE dis=NONE) header.from=zte.com.cn Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i19-20020aa796f3000000b0063d26ee2cf0si1385392pfq.143.2023.05.04.23.31.27; Thu, 04 May 2023 23:31:42 -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=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229972AbjEEGMt (ORCPT + 99 others); Fri, 5 May 2023 02:12:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43822 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229807AbjEEGMs (ORCPT ); Fri, 5 May 2023 02:12:48 -0400 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F70E1490F for ; Thu, 4 May 2023 23:12:46 -0700 (PDT) Received: from mse-fl1.zte.com.cn (unknown [10.5.228.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4QCL2N02z5z5B14q; Fri, 5 May 2023 14:12:44 +0800 (CST) Received: from xaxapp02.zte.com.cn ([10.88.97.241]) by mse-fl1.zte.com.cn with SMTP id 3456Cbab063060; Fri, 5 May 2023 14:12:37 +0800 (+08) (envelope-from ye.xingchen@zte.com.cn) Received: from mapi (xaxapp02[null]) by mapi (Zmail) with MAPI id mid31; Fri, 5 May 2023 14:12:39 +0800 (CST) Date: Fri, 5 May 2023 14:12:39 +0800 (CST) X-Zmail-TransId: 2afa64549e57ffffffff917-7d156 X-Mailer: Zmail v1.0 Message-ID: <202305051412396252364@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , , , , Subject: =?UTF-8?B?W1BBVENIXSBpb21tdWZkL3NlbGZ0ZXN0OiBVc2UgZmRnZXQoKSBhbmQgZmRwdXQoKQ==?= Content-Type: text/plain; charset="UTF-8" X-MAIL: mse-fl1.zte.com.cn 3456Cbab063060 X-Fangmail-Gw-Spam-Type: 0 X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 64549E5C.000/4QCL2N02z5z5B14q X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY 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 From: Ye Xingchen convert the fget()/fput() uses to fdget()/fdput(). Signed-off-by: Ye Xingchen --- drivers/iommu/iommufd/selftest.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/iommu/iommufd/selftest.c b/drivers/iommu/iommufd/selftest.c index 74c2076105d4..d3512fa673a5 100644 --- a/drivers/iommu/iommufd/selftest.c +++ b/drivers/iommu/iommufd/selftest.c @@ -583,17 +583,16 @@ static const struct file_operations iommfd_test_staccess_fops; static struct selftest_access *iommufd_access_get(int fd) { - struct file *file; + struct fd f = fdget(fd); - file = fget(fd); - if (!file) + if (!f.file) return ERR_PTR(-EBADFD); - if (file->f_op != &iommfd_test_staccess_fops) { - fput(file); + if (f.file->f_op != &iommfd_test_staccess_fops) { + fdput(f); return ERR_PTR(-EBADFD); } - return file->private_data; + return f.file->private_data; } static void iommufd_test_access_unmap(void *data, unsigned long iova, -- 2.25.1