From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com ([209.132.183.28]:58607 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1947678AbcBSOAX (ORCPT ); Fri, 19 Feb 2016 09:00:23 -0500 From: Andreas Gruenbacher Cc: Wei Yongjun , Subject: [PATCH] vfs: fix missing unlock on error in simple_xattr_list() Date: Fri, 19 Feb 2016 15:00:18 +0100 Message-Id: <1455890418-18353-2-git-send-email-agruenba@redhat.com> In-Reply-To: <1455890418-18353-1-git-send-email-agruenba@redhat.com> References: <1455890418-18353-1-git-send-email-agruenba@redhat.com> To: unlisted-recipients:; (no To-header on input) Sender: stable-owner@vger.kernel.org List-ID: From: Wei Yongjun From: Wei Yongjun Add the missing unlock before return from function simple_xattr_list() in the error handling case. Fixes: 786534b92f3c (tmpfs: listxattr should include POSIX ACL xattrs) Signed-off-by: Wei Yongjun Reviewed-by: Andreas Gruenbacher Cc: # 4.4 --- fs/xattr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/xattr.c b/fs/xattr.c index 07d0e47..d4f8487 100644 --- a/fs/xattr.c +++ b/fs/xattr.c @@ -964,8 +964,10 @@ ssize_t simple_xattr_list(struct inode *inode, struct simple_xattrs *xattrs, continue; err = xattr_list_one(&buffer, &remaining_size, xattr->name); - if (err) + if (err) { + spin_unlock(&xattrs->lock); return err; + } } spin_unlock(&xattrs->lock); -- 2.4.3