All of lore.kernel.org
 help / color / mirror / Atom feed
From: weiyj_lk@163.com
To: Alexander Viro <viro@zeniv.linux.org.uk>,
	Andreas Gruenbacher <agruenba@redhat.com>
Cc: Wei Yongjun <yongjun_wei@trendmicro.com.cn>,
	linux-fsdevel@vger.kernel.org
Subject: [PATCH] vfs: fix missing unlock on error in simple_xattr_list()
Date: Fri,  5 Feb 2016 21:50:02 +0800	[thread overview]
Message-ID: <1454680202-17959-1-git-send-email-weiyj_lk@163.com> (raw)

From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>

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 <yongjun_wei@trendmicro.com.cn>
---
 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);
 


             reply	other threads:[~2016-02-05 13:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-05 13:50 weiyj_lk [this message]
2016-02-05 15:51 ` [PATCH] vfs: fix missing unlock on error in simple_xattr_list() Andreas Grünbacher
2016-02-05 16:33   ` Al Viro
     [not found] <1455890418-18353-1-git-send-email-agruenba@redhat.com>
2016-02-19 14:00 ` Andreas Gruenbacher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1454680202-17959-1-git-send-email-weiyj_lk@163.com \
    --to=weiyj_lk@163.com \
    --cc=agruenba@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=yongjun_wei@trendmicro.com.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.