Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

apparmor: Remove redundant if check in sk_peer_get_label

Remove the redundant if check in sk_peer_get_label() and return
ERR_PTR(-ENOPROTOOPT) directly.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Signed-off-by: John Johansen <john.johansen@canonical.com>

authored by

Thorsten Blum and committed by
John Johansen
e6a522c5 46401cc9

+1 -5
+1 -5
security/apparmor/lsm.c
··· 1523 1523 static struct aa_label *sk_peer_get_label(struct sock *sk) 1524 1524 { 1525 1525 struct aa_sk_ctx *ctx = aa_sock(sk); 1526 - struct aa_label *label = ERR_PTR(-ENOPROTOOPT); 1527 1526 1528 1527 if (rcu_access_pointer(ctx->peer)) 1529 1528 return aa_get_label_rcu(&ctx->peer); 1530 1529 1531 - if (sk->sk_family != PF_UNIX) 1532 - return ERR_PTR(-ENOPROTOOPT); 1533 - 1534 - return label; 1530 + return ERR_PTR(-ENOPROTOOPT); 1535 1531 } 1536 1532 1537 1533 /**