From patchwork Fri Oct 5 09:35:07 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tsutomu Itoh X-Patchwork-Id: 1552211 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 2FC773FCFC for ; Fri, 5 Oct 2012 09:35:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932093Ab2JEJfi (ORCPT ); Fri, 5 Oct 2012 05:35:38 -0400 Received: from fgwmail5.fujitsu.co.jp ([192.51.44.35]:35230 "EHLO fgwmail5.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932068Ab2JEJfh (ORCPT ); Fri, 5 Oct 2012 05:35:37 -0400 Received: from m3.gw.fujitsu.co.jp (unknown [10.0.50.73]) by fgwmail5.fujitsu.co.jp (Postfix) with ESMTP id B9C5B3EE0C1 for ; Fri, 5 Oct 2012 18:35:35 +0900 (JST) Received: from smail (m3 [127.0.0.1]) by outgoing.m3.gw.fujitsu.co.jp (Postfix) with ESMTP id 9BEBE45DEB5 for ; Fri, 5 Oct 2012 18:35:35 +0900 (JST) Received: from s3.gw.fujitsu.co.jp (s3.gw.fujitsu.co.jp [10.0.50.93]) by m3.gw.fujitsu.co.jp (Postfix) with ESMTP id 852D545DEB2 for ; Fri, 5 Oct 2012 18:35:35 +0900 (JST) Received: from s3.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s3.gw.fujitsu.co.jp (Postfix) with ESMTP id 765541DB803C for ; Fri, 5 Oct 2012 18:35:35 +0900 (JST) Received: from m1000.s.css.fujitsu.com (m1000.s.css.fujitsu.com [10.240.81.136]) by s3.gw.fujitsu.co.jp (Postfix) with ESMTP id 2D3501DB8038 for ; Fri, 5 Oct 2012 18:35:35 +0900 (JST) Received: from m1000.css.fujitsu.com (m1000 [127.0.0.1]) by m1000.s.css.fujitsu.com (Postfix) with ESMTP id 0365360FAB; Fri, 5 Oct 2012 18:35:35 +0900 (JST) Received: from FM-323941448.jp.fujitsu.com (unknown [10.124.101.87]) by m1000.s.css.fujitsu.com (Postfix) with SMTP id B8DB260EAD; Fri, 5 Oct 2012 18:35:34 +0900 (JST) X-SecurityPolicyCheck: OK by SHieldMailChecker v1.7.4 Message-Id: <201210050935.AA00014@FM-323941448.jp.fujitsu.com> From: Tsutomu Itoh Date: Fri, 05 Oct 2012 18:35:07 +0900 To: linux-btrfs@vger.kernel.org Cc: chris.mason@fusionio.com Subject: [PATCH] Btrfs: fix error processing in btrfs_set_acl() MIME-Version: 1.0 X-Mailer: AL-Mail32 Version 1.13 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org The error is only returned when kmalloc() fails. Therefore, to return the error to the caller directly here, I changed the code. Signed-off-by: Tsutomu Itoh --- fs/btrfs/acl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c index 761e2cd..74ee421 100644 --- a/fs/btrfs/acl.c +++ b/fs/btrfs/acl.c @@ -136,10 +136,8 @@ static int btrfs_set_acl(struct btrfs_trans_handle *trans, if (acl) { size = posix_acl_xattr_size(acl->a_count); value = kmalloc(size, GFP_NOFS); - if (!value) { - ret = -ENOMEM; - goto out; - } + if (!value) + return -ENOMEM; ret = posix_acl_to_xattr(acl, value, size); if (ret < 0)