afs: Fix afs_xattr_get_yfs() to not try freeing an error value
authorDavid Howells <dhowells@redhat.com>
Sun, 12 May 2019 07:31:23 +0000 (08:31 +0100)
committerDavid Howells <dhowells@redhat.com>
Wed, 15 May 2019 16:35:53 +0000 (17:35 +0100)
commit773e0c40253443e0ce5491cb0e414b62f7cc45ed
tree48752e7b9ff1ec36c9baeadc7e4f11ebf16addf7
parentcc1dd5c85cb70ebe09ccf1cc34f29af65442a10f
afs: Fix afs_xattr_get_yfs() to not try freeing an error value

afs_xattr_get_yfs() tries to free yacl, which may hold an error value (say
if yfs_fs_fetch_opaque_acl() failed and returned an error).

Fix this by allocating yacl up front (since it's a fixed-length struct,
unlike afs_acl) and passing it in to the RPC function.  This also allows
the flags to be placed in the object rather than passing them through to
the RPC function.

Fixes: ae46578b963f ("afs: Get YFS ACLs and information through xattrs")
Signed-off-by: David Howells <dhowells@redhat.com>
fs/afs/internal.h
fs/afs/xattr.c
fs/afs/yfsclient.c