Pull userns bug fix from Eric Biederman: "Just a small fix to properly set the return code on error" * 'userns-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: commoncap: Handle memory allocation failure.
Unified · Split
| @@ -449,6 +449,8 @@ int cap_inode_getsecurity(struct inode *inode, const char *name, void **buffer, · 448 unmodified lines | ||
| 449 | 449 | magic |= VFS_CAP_FLAGS_EFFECTIVE; |
| 450 | 450 | memcpy(&cap->data, &nscap->data, sizeof(__le32) * 2 * VFS_CAP_U32); |
| 451 | 451 | cap->magic_etc = cpu_to_le32(magic); |
| 452 | + } else { | |
| 453 | + size = -ENOMEM; | |
| 452 | 454 | } |
| 453 | 455 | } |
| 454 | 456 | kfree(tmpbuf); |