path: root/security/selinux
diff options
authorLinus Torvalds <>2020-11-14 12:04:02 -0800
committerLinus Torvalds <>2020-11-14 12:04:02 -0800
commit30636a59f4c1a40720156079cabcad60351949f2 (patch)
tree7d7faafe280e76238d3906c6428f1d812cbad196 /security/selinux
parent4aea779d35120d5062647d288817678decb28c10 (diff)
parentc350f8bea271782e2733419bd2ab9bf4ec2051ef (diff)
Merge tag 'selinux-pr-20201113' of git://
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:// selinux: Fix error return code in sel_ib_pkey_sid_slow()
Diffstat (limited to 'security/selinux')
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;