Commit 46977ef9 authored by Chen Zhou's avatar Chen Zhou Committed by Greg Kroah-Hartman
Browse files

selinux: Fix error return code in sel_ib_pkey_sid_slow()

commit c350f8be upstream.

Fix to return a negative error code from the error handling case
instead of 0 in function sel_ib_pkey_sid_slow(), as done elsewhere
in this function.

Cc: stable@vger.kernel.org
Fixes: 409dcf31

 ("selinux: Add a cache for quicker retreival of PKey SIDs")
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarChen Zhou <chenzhou10@huawei.com>
Signed-off-by: default avatarPaul Moore <paul@paul-moore.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent b0f6ea85
linux-4.19.y Tags unavailable
No related merge requests found
Showing with 3 additions and 1 deletion
+3 -1
......@@ -161,8 +161,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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment