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=-9.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,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 8E32CC282C4 for ; Mon, 4 Feb 2019 16:54:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 51C492087C for ; Mon, 4 Feb 2019 16:54:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549299276; bh=eCiwqbygTqLeQzCs5hGYfFNbP8Vzw08y1eAuMr6MclA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=puox9eCou4w1fuO4hhMl69HI7tAfv1MsRdisG9f4vhSMMEQtwvb7cwgSV05XTiiFZ ti0rKhABLLnd4l/F0eGMlZUa34tqM6fD5ukxUgbZCOfIp+FVIn3f87i+AvTste9arQ Xd4eC7s8LC6FrBMfPI2YzktkyoODNMxR6804C7b8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728657AbfBDQyf (ORCPT ); Mon, 4 Feb 2019 11:54:35 -0500 Received: from mail.kernel.org ([198.145.29.99]:37916 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727308AbfBDQyf (ORCPT ); Mon, 4 Feb 2019 11:54:35 -0500 Received: from garbanzo.lan (c-73-71-40-85.hsd1.ca.comcast.net [73.71.40.85]) (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 959A62176F; Mon, 4 Feb 2019 16:54:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549299274; bh=eCiwqbygTqLeQzCs5hGYfFNbP8Vzw08y1eAuMr6MclA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=F87DyXbhiHvapNHPJpoMOW3aXM4AcQS7ugf530fQ+YdPmftXKF5Ul/49BmSw4cGWH jpa6EgP4bf4A1caPLEKCOYN6Pe4mJsVCZcAYNLxaM9S8moE9FIaq11MoXJyvG0ksiC /phTBO3Ztw04NzPosyl9ryPHqGCwOgtXGCUbWJCE= From: Luis Chamberlain To: linux-xfs@vger.kernel.org, gregkh@linuxfoundation.org, Alexander.Levin@microsoft.com Cc: stable@vger.kernel.org, amir73il@gmail.com, hch@infradead.org, Christophe JAILLET , "Darrick J . Wong" , Luis Chamberlain Subject: [PATCH v2 03/10] xfs: Fix error code in 'xfs_ioc_getbmap()' Date: Mon, 4 Feb 2019 08:54:20 -0800 Message-Id: <20190204165427.23607-4-mcgrof@kernel.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20190204165427.23607-1-mcgrof@kernel.org> References: <20190204165427.23607-1-mcgrof@kernel.org> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Christophe JAILLET commit 132bf6723749f7219c399831eeb286dbbb985429 upstream. In this function, once 'buf' has been allocated, we unconditionally return 0. However, 'error' is set to some error codes in several error handling paths. Before commit 232b51948b99 ("xfs: simplify the xfs_getbmap interface") this was not an issue because all error paths were returning directly, but now that some cleanup at the end may be needed, we must propagate the error code. Fixes: 232b51948b99 ("xfs: simplify the xfs_getbmap interface") Signed-off-by: Christophe JAILLET Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Signed-off-by: Luis Chamberlain --- fs/xfs/xfs_ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c index 0ef5ece5634c..bad90479ade2 100644 --- a/fs/xfs/xfs_ioctl.c +++ b/fs/xfs/xfs_ioctl.c @@ -1616,7 +1616,7 @@ xfs_ioc_getbmap( error = 0; out_free_buf: kmem_free(buf); - return 0; + return error; } struct getfsmap_info { -- 2.18.0