All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] btrfs: add check for ERR_PTR()
@ 2010-04-21 10:32 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2010-04-21 10:32 UTC (permalink / raw)
  To: Chris Mason
  Cc: Al Viro, Joel Becker, James Morris, Christoph Hellwig,
	linux-btrfs, kernel-janitors

posix_acl_from_xattr() can sometimes return an ERR_PTR().

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c
index 6ef7b26..c6d84ce 100644
--- a/fs/btrfs/acl.c
+++ b/fs/btrfs/acl.c
@@ -60,7 +60,8 @@ static struct posix_acl *btrfs_get_acl(struct inode *inode, int type)
 		size = __btrfs_getxattr(inode, name, value, size);
 		if (size > 0) {
 			acl = posix_acl_from_xattr(value, size);
-			set_cached_acl(inode, type, acl);
+			if (!IS_ERR(acl))
+				set_cached_acl(inode, type, acl);
 		}
 		kfree(value);
 	} else if (size = -ENOENT || size = -ENODATA || size = 0) {

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [patch] btrfs: add check for ERR_PTR()
@ 2010-04-21 10:32 ` Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Carpenter @ 2010-04-21 10:32 UTC (permalink / raw)
  To: Chris Mason
  Cc: Al Viro, Joel Becker, James Morris, Christoph Hellwig,
	linux-btrfs, kernel-janitors

posix_acl_from_xattr() can sometimes return an ERR_PTR().

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c
index 6ef7b26..c6d84ce 100644
--- a/fs/btrfs/acl.c
+++ b/fs/btrfs/acl.c
@@ -60,7 +60,8 @@ static struct posix_acl *btrfs_get_acl(struct inode *inode, int type)
 		size = __btrfs_getxattr(inode, name, value, size);
 		if (size > 0) {
 			acl = posix_acl_from_xattr(value, size);
-			set_cached_acl(inode, type, acl);
+			if (!IS_ERR(acl))
+				set_cached_acl(inode, type, acl);
 		}
 		kfree(value);
 	} else if (size == -ENOENT || size == -ENODATA || size == 0) {

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-04-21 10:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-21 10:32 [patch] btrfs: add check for ERR_PTR() Dan Carpenter
2010-04-21 10:32 ` Dan Carpenter

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.