Return-Path: Received: from mail-pg1-f195.google.com ([209.85.215.195]:46335 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726020AbeKRBAj (ORCPT ); Sat, 17 Nov 2018 20:00:39 -0500 Received: by mail-pg1-f195.google.com with SMTP id w7so11858531pgp.13 for ; Sat, 17 Nov 2018 06:43:46 -0800 (PST) To: Alexander Viro Cc: "linux-aio@kvack.org" , linux-fsdevel From: Jens Axboe Subject: [PATCH v2] aio: fix failure to put the file pointer Message-ID: Date: Sat, 17 Nov 2018 07:43:42 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-fsdevel-owner@vger.kernel.org List-ID: If the ioprio capability check fails, we return without putting the file pointer. Fixes: d9a08a9e616b ("fs: Add aio iopriority support") Signed-off-by: Jens Axboe diff --git a/fs/aio.c b/fs/aio.c index b36691268b6c..3d9bc81cf500 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -1436,6 +1436,7 @@ static int aio_prep_rw(struct kiocb *req, struct iocb *iocb) ret = ioprio_check_cap(iocb->aio_reqprio); if (ret) { pr_debug("aio ioprio check cap error: %d\n", ret); + fput(req->ki_filp); return ret; } -- Jens Axboe