diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2020-11-14 21:04:02 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2020-11-14 21:04:02 +0100 |
commit | 30636a59f4c1a40720156079cabcad60351949f2 (patch) | |
tree | 7d7faafe280e76238d3906c6428f1d812cbad196 /security | |
parent | Merge tag 'for-linus-5.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/g... (diff) | |
parent | selinux: Fix error return code in sel_ib_pkey_sid_slow() (diff) | |
download | linux-30636a59f4c1a40720156079cabcad60351949f2.tar.xz linux-30636a59f4c1a40720156079cabcad60351949f2.zip |
Merge tag 'selinux-pr-20201113' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux
Pull selinux fix from Paul Moore:
"One small SELinux patch to make sure we return an error code when an
allocation fails. It passes all of our tests, but given the nature of
the patch that isn't surprising"
* tag 'selinux-pr-20201113' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux:
selinux: Fix error return code in sel_ib_pkey_sid_slow()
Diffstat (limited to 'security')
-rw-r--r-- | security/selinux/ibpkey.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/security/selinux/ibpkey.c b/security/selinux/ibpkey.c index f68a7617cfb9..3a63a989e55e 100644 --- a/security/selinux/ibpkey.c +++ b/security/selinux/ibpkey.c @@ -151,8 +151,10 @@ static int sel_ib_pkey_sid_slow(u64 subnet_prefix, u16 pkey_num, u32 *sid) * is valid, it just won't be added to the cache. */ new = kzalloc(sizeof(*new), GFP_ATOMIC); - if (!new) + if (!new) { + ret = -ENOMEM; goto out; + } new->psec.subnet_prefix = subnet_prefix; new->psec.pkey = pkey_num; |