X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=security%2Fselinux%2Fxfrm.c;h=c0eb72013d671a75a155481749b702a262521d65;hb=ae27d84351f1f3568118318a8c40ff3a154bd629;hp=3b8b994faad48a87fe0b3c5ef739ac2a63dcac2e;hpb=d7b1acd3b524b39f418e463e836b48ac041954d6;p=safe%2Fjmp%2Flinux-2.6 diff --git a/security/selinux/xfrm.c b/security/selinux/xfrm.c index 3b8b994..c0eb720 100644 --- a/security/selinux/xfrm.c +++ b/security/selinux/xfrm.c @@ -180,8 +180,7 @@ int selinux_xfrm_decode_session(struct sk_buff *skb, u32 *sid, int ckall) if (!ckall) break; - } - else if (*sid != ctx->ctx_sid) + } else if (*sid != ctx->ctx_sid) return -EINVAL; } } @@ -198,7 +197,7 @@ static int selinux_xfrm_sec_ctx_alloc(struct xfrm_sec_ctx **ctxp, struct xfrm_user_sec_ctx *uctx, u32 sid) { int rc = 0; - struct task_security_struct *tsec = current->security; + const struct task_security_struct *tsec = current_security(); struct xfrm_sec_ctx *ctx = NULL; char *ctx_str = NULL; u32 str_len; @@ -326,8 +325,7 @@ int selinux_xfrm_policy_clone(struct xfrm_sec_ctx *old_ctx, */ void selinux_xfrm_policy_free(struct xfrm_sec_ctx *ctx) { - if (ctx) - kfree(ctx); + kfree(ctx); } /* @@ -335,7 +333,7 @@ void selinux_xfrm_policy_free(struct xfrm_sec_ctx *ctx) */ int selinux_xfrm_policy_delete(struct xfrm_sec_ctx *ctx) { - struct task_security_struct *tsec = current->security; + const struct task_security_struct *tsec = current_security(); int rc = 0; if (ctx) { @@ -372,8 +370,7 @@ int selinux_xfrm_state_alloc(struct xfrm_state *x, struct xfrm_user_sec_ctx *uct void selinux_xfrm_state_free(struct xfrm_state *x) { struct xfrm_sec_ctx *ctx = x->security; - if (ctx) - kfree(ctx); + kfree(ctx); } /* @@ -381,7 +378,7 @@ void selinux_xfrm_state_free(struct xfrm_state *x) */ int selinux_xfrm_state_delete(struct xfrm_state *x) { - struct task_security_struct *tsec = current->security; + const struct task_security_struct *tsec = current_security(); struct xfrm_sec_ctx *ctx = x->security; int rc = 0;