HomeFreeBSD

pf: counter argument to pfr_pool_get() may never be NULL

Description

pf: counter argument to pfr_pool_get() may never be NULL

Coverity points out that if counter was NULL when passed to
pfr_pool_get() we could potentially end up dereferencing it.
Happily all users of the function pass a non-NULL pointer. Enforce this
by assertion and remove the pointless NULL check.

Reported by: Coverity (CID 273309)
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")

(cherry picked from commit efc64d02a62f3254ecc0b22fcbcb8f73a079669f)

Details

Provenance
kpAuthored on Apr 21 2022, 12:53 PM
Parents
rG160e2dbfb48d: pfsync: NULL check before dereference
Branches
Unknown
Tags
Unknown