From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from zeniv.linux.org.uk ([195.92.253.2]:54516 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726020AbeKRA5G (ORCPT ); Sat, 17 Nov 2018 19:57:06 -0500 Date: Sat, 17 Nov 2018 14:40:10 +0000 From: Al Viro To: Jens Axboe Cc: "linux-aio@kvack.org" , linux-fsdevel Subject: Re: [PATCH] aio: fix failure to put the file pointer Message-ID: <20181117144010.GH32577@ZenIV.linux.org.uk> References: <80eae85d-c307-71fb-bdfe-5a38236fbf87@kernel.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <80eae85d-c307-71fb-bdfe-5a38236fbf87@kernel.dk> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: On Sat, Nov 17, 2018 at 07:37:44AM -0700, Jens Axboe wrote: > 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..9075571e673f 100644 > --- a/fs/aio.c > +++ b/fs/aio.c > @@ -1436,7 +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); > - return ret; > + goto err; Better an explicit fput() here, IMO...