From patchwork Wed Dec 5 09:34:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 10713759 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 85E9117D5 for ; Wed, 5 Dec 2018 10:10:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7723F2CD3A for ; Wed, 5 Dec 2018 10:10:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6B70A2CD41; Wed, 5 Dec 2018 10:10:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 200EB2CD3A for ; Wed, 5 Dec 2018 10:10:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728194AbeLEJiS (ORCPT ); Wed, 5 Dec 2018 04:38:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:41896 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728185AbeLEJiP (ORCPT ); Wed, 5 Dec 2018 04:38:15 -0500 Received: from sasha-vm.mshome.net (unknown [213.57.143.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6F5F320879; Wed, 5 Dec 2018 09:38:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544002694; bh=8/NSJE15qDY42L3S+9BrSODsCRJSktB3+bDcni6tRb4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qpvOeL6PiEhQmndbq6wWffOW1nPiAaBYekHELEyuDPjnEzGsuys0bJ4UEmtn2sBo+ za/doPRbRkdXbmu+CjTSKs/48V8uKvXdpwzkFCO/rIQ4VMwzZH0/YAf5B3dNuBLnXF R8tvMioV6+I/BFVbcKAgXo4k4DlZDPil6JVX2+Mw= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jens Axboe , Al Viro , Sasha Levin , linux-fsdevel@vger.kernel.org, linux-aio@kvack.org Subject: [PATCH AUTOSEL 4.19 041/123] aio: fix failure to put the file pointer Date: Wed, 5 Dec 2018 04:34:33 -0500 Message-Id: <20181205093555.5386-41-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181205093555.5386-1-sashal@kernel.org> References: <20181205093555.5386-1-sashal@kernel.org> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jens Axboe [ Upstream commit 53fffe29a9e664a999dd3787e4428da8c30533e0 ] 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 Signed-off-by: Al Viro Signed-off-by: Sasha Levin --- fs/aio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/aio.c b/fs/aio.c index b9350f3360c6..04c4d6218978 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; }