]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
inpcb: Remove NULL checks of credential references
authorMark Johnston <markj@FreeBSD.org>
Wed, 2 Nov 2022 17:03:41 +0000 (13:03 -0400)
committerMark Johnston <markj@FreeBSD.org>
Wed, 2 Nov 2022 17:46:24 +0000 (13:46 -0400)
commitac1750dd143e53225c518bc1ca0462c3fffe10f6
treea8ce75fd4f855a34f8ee7d19e8cf8000f2db7439
parentd0f8e31761b7de6010e8b3ed49a1a5f9fc5726f7
inpcb: Remove NULL checks of credential references

Some auditing of the code shows that "cred" is never non-NULL in these
functions, either because all callers pass a non-NULL reference or
because they unconditionally dereference "cred".  So, let's simplify the
code a bit and remove NULL checks.  No functional change intended.

Reviewed by: glebius
MFC after: 1 week
Sponsored by: Modirum MDPay
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D37025
sys/netinet/in_pcb.c
sys/netinet6/in6_pcb.c