From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DE8F1C04EB9 for ; Wed, 5 Dec 2018 09:38:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9FA50208E7 for ; Wed, 5 Dec 2018 09:38:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="qpvOeL6P" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9FA50208E7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728216AbeLEJiU (ORCPT ); Wed, 5 Dec 2018 04:38:20 -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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; } -- 2.17.1