Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp356006rwr; Thu, 4 May 2023 20:54:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7l2mQZ4duCZyzlCMGwG95TEqxDLTOC1ICjQNyuLAtDlTUAfjMSyydmeh1XdIBlcjPAjmqR X-Received: by 2002:a05:6a20:4402:b0:f0:2084:4cab with SMTP id ce2-20020a056a20440200b000f020844cabmr76365pzb.36.1683258893775; Thu, 04 May 2023 20:54:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683258893; cv=none; d=google.com; s=arc-20160816; b=CJKsYycNDh/OOuB27yo/spBXAfow6Ti7oYR7aKUSQYy/ADB8hUjXE3kbnZfR8YM2uO TGJX/B6iN5HLYFOwNpYGY3kmGOlq0VIGLfJKDBdelasbDIVdpgOM4AFtsB5Vzti9hq0r uQ4GHzanKSG3g7Js9u9hi84PD5tqdBTvcpOtjLGlpiVQcLRCfqAt/KZOHzP35qwHW1cs d3v68zAeDE6s7f1ognQVq1iQjJbvZjkEDGHRm2B14i2iqhBccmWB/jIltnNsi7QK1bBu 1Loa6/ZMdxWmsqLWqii8hqgmeRqd8arV6/jJ2XkszDoyGZz8wLuRKdtUNKKu3/ySBYDQ TW9w== 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=ROyIhXN0OLVMPPt1GV8mY+JSsuu2HWOUETrOR5YFPRw=; b=n5EwI68dTfKjm9eaat5vJ1RWk7A5Hephl2LG+/M3dPbaK03nj9IM0cmTPQCqrhVTMm AZfAZiyNsRuqVnj/jN0npoe2Xt7aWw0G+GFmp0AqvZAqttz44sYslL7U67YGzrK5wBYU 04VgsuZ3zEhnQZ2QcaIqeC6IsEUd0Udh1LbadYg8r+ajGmZjBfHy2r5+N7WdArm8erB9 yzI0/HQz2YFjBV6sjQSxNn7IzOnvm2/cnvhhUGqSwAdCxy1+lZNVnS8eghXxN61w0Xrb 0V+dqrQz66FFb6pejJUmX8KoKSsl4NL8ji7abShWBA+wzcv0g+ohPcQMVApK39PUozRX V8RQ== 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 t63-20020a638142000000b0050beec2c6cdsi1127990pgd.238.2023.05.04.20.54.38; Thu, 04 May 2023 20:54:53 -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 S229675AbjEEDeH (ORCPT + 99 others); Thu, 4 May 2023 23:34:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229502AbjEEDeF (ORCPT ); Thu, 4 May 2023 23:34:05 -0400 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 593E1F4; Thu, 4 May 2023 20:34:04 -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 4QCGWG6D18z8RTWl; Fri, 5 May 2023 11:34:02 +0800 (CST) Received: from xaxapp02.zte.com.cn ([10.88.97.241]) by mse-fl1.zte.com.cn with SMTP id 3453Xumv053050; Fri, 5 May 2023 11:33:56 +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 11:33:57 +0800 (CST) Date: Fri, 5 May 2023 11:33:57 +0800 (CST) X-Zmail-TransId: 2afa64547925ffffffff8df-fa29f X-Mailer: Zmail v1.0 Message-ID: <202305051133576690069@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , , Subject: =?UTF-8?B?W1BBVENIXSBSRE1BL2NvcmU6IFVzZSBmZGdldCgpIGFuZCBmZHB1dCgp?= Content-Type: text/plain; charset="UTF-8" X-MAIL: mse-fl1.zte.com.cn 3453Xumv053050 X-Fangmail-Gw-Spam-Type: 0 X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 6454792A.000/4QCGWG6D18z8RTWl X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_MSPIKE_H2, 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/infiniband/core/rdma_core.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/infiniband/core/rdma_core.c b/drivers/infiniband/core/rdma_core.c index 29b1ab1d5f93..c35df0b27e86 100644 --- a/drivers/infiniband/core/rdma_core.c +++ b/drivers/infiniband/core/rdma_core.c @@ -335,7 +335,7 @@ lookup_get_fd_uobject(const struct uverbs_api_object *obj, enum rdma_lookup_mode mode) { const struct uverbs_obj_fd_type *fd_type; - struct file *f; + struct fd f = fdget(fdno); struct ib_uobject *uobject; int fdno = id; @@ -350,18 +350,17 @@ lookup_get_fd_uobject(const struct uverbs_api_object *obj, fd_type = container_of(obj->type_attrs, struct uverbs_obj_fd_type, type); - f = fget(fdno); - if (!f) + if (!f.file) return ERR_PTR(-EBADF); - uobject = f->private_data; + uobject = f.file->private_data; /* * fget(id) ensures we are not currently running * uverbs_uobject_fd_release(), and the caller is expected to ensure * that release is never done while a call to lookup is possible. */ - if (f->f_op != fd_type->fops || uobject->ufile != ufile) { - fput(f); + if (f.file->f_op != fd_type->fops || uobject->ufile != ufile) { + fdput(f); return ERR_PTR(-EBADF); } -- 2.25.1