mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-03 23:58:05 +00:00
afs: Fix incorrect error handling in afs_xattr_get_acl()
Fix incorrect error handling in afs_xattr_get_acl() where there appears to
be a redundant assignment before return, but in fact the return should be a
goto to the error handling at the end of the function.
Fixes: 260f082bae
("afs: Get an AFS3 ACL as an xattr")
Addresses-Coverity: ("Unused Value")
Reported-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: David Howells <dhowells@redhat.com>
cc: Joe Perches <joe@perches.com>
This commit is contained in:
parent
a1b879eefc
commit
cc1dd5c85c
1 changed files with 4 additions and 5 deletions
|
@ -71,11 +71,10 @@ static int afs_xattr_get_acl(const struct xattr_handler *handler,
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
ret = acl->size;
|
ret = acl->size;
|
||||||
if (size > 0) {
|
if (size > 0) {
|
||||||
ret = -ERANGE;
|
if (acl->size <= size)
|
||||||
if (acl->size > size)
|
|
||||||
return -ERANGE;
|
|
||||||
memcpy(buffer, acl->data, acl->size);
|
memcpy(buffer, acl->data, acl->size);
|
||||||
ret = acl->size;
|
else
|
||||||
|
ret = -ERANGE;
|
||||||
}
|
}
|
||||||
kfree(acl);
|
kfree(acl);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue