Skip to content

Commit

Permalink
Merge tag 'selinux-pr-20201113' of git://git.kernel.org/pub/scm/linux…
Browse files Browse the repository at this point in the history
…/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()
  • Loading branch information
torvalds committed Nov 14, 2020
2 parents 4aea779 + c350f8b commit 30636a5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion security/selinux/ibpkey.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 30636a5

Please sign in to comment.