From patchwork Fri May 5 03:03:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ye.xingchen@zte.com.cn X-Patchwork-Id: 679481 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3F24C77B73 for ; Fri, 5 May 2023 03:04:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229818AbjEEDEH (ORCPT ); Thu, 4 May 2023 23:04:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46432 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229768AbjEEDDv (ORCPT ); Thu, 4 May 2023 23:03:51 -0400 Received: from mxct.zte.com.cn (mxct.zte.com.cn [183.62.165.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4613B11B7C; Thu, 4 May 2023 20:03:50 -0700 (PDT) Received: from mse-fl2.zte.com.cn (unknown [10.5.228.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxct.zte.com.cn (FangMail) with ESMTPS id 4QCFrN1bVGz4y3Zj; Fri, 5 May 2023 11:03:48 +0800 (CST) Received: from xaxapp01.zte.com.cn ([10.88.99.176]) by mse-fl2.zte.com.cn with SMTP id 34533ca6093308; Fri, 5 May 2023 11:03:38 +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:03:39 +0800 (CST) Date: Fri, 5 May 2023 11:03:39 +0800 (CST) X-Zmail-TransId: 2afa6454720b650-79091 X-Mailer: Zmail v1.0 Message-ID: <202305051103396748797@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , , , , Subject: =?utf-8?q?=5BPATCH=5D_dma-buf/sync=5Ffile=3A_Use_fdget=28=29?= X-MAIL: mse-fl2.zte.com.cn 34533ca6093308 X-Fangmail-Gw-Spam-Type: 0 X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 64547213.000/4QCFrN1bVGz4y3Zj Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Ye Xingchen convert the fget() use to fdget(). Signed-off-by: Ye Xingchen --- drivers/dma-buf/sync_file.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/dma-buf/sync_file.c b/drivers/dma-buf/sync_file.c index af57799c86ce..222b13b1bdb8 100644 --- a/drivers/dma-buf/sync_file.c +++ b/drivers/dma-buf/sync_file.c @@ -78,18 +78,18 @@ EXPORT_SYMBOL(sync_file_create); static struct sync_file *sync_file_fdget(int fd) { - struct file *file = fget(fd); + struct struct fd f = fdget(fd); - if (!file) + if (!f.file) return NULL; - if (file->f_op != &sync_file_fops) + if (f.file->f_op != &sync_file_fops) goto err; - return file->private_data; + return f.file->private_data; err: - fput(file); + fdput(f); return NULL; }