The trivial simplification patch is attached. br, KK
>From 9b209da2e749ffb869ac91b90df71d14cd5970d6 Mon Sep 17 00:00:00 2001 From: Kalevi Kolttonen <kalevi@xxxxxxxxxxxx> Date: Mon, 12 May 2025 22:14:19 +0300 Subject: [PATCH] A trivial simplification to shorten the code a bit. --- security/selinux/hooks.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index e7a7dcab81db..337951fb81e0 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -6693,14 +6693,10 @@ static int selinux_secid_to_secctx(u32 secid, struct lsm_context *cp) if (cp) { cp->id = LSM_ID_SELINUX; ret = security_sid_to_context(secid, &cp->context, &cp->len); - if (ret < 0) - return ret; - return cp->len; + return (ret < 0) ? ret : cp->len; } ret = security_sid_to_context(secid, NULL, &seclen); - if (ret < 0) - return ret; - return seclen; + return (ret < 0) ? ret : seclen; } static int selinux_lsmprop_to_secctx(struct lsm_prop *prop, -- 2.49.0
-- _______________________________________________ selinux mailing list -- selinux@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to selinux-leave@xxxxxxxxxxxxxxxxxxxxxxx Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/selinux@xxxxxxxxxxxxxxxxxxxxxxx Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue