HomeFreeBSD

The recent changes to move the ref count increment

Description

The recent changes to move the ref count increment
back from the end of the function created an issue.
If one of the routines returns NULL during setup
we have inp's with extra references (which is why
the increment was at the end).

Also the stack switch return code was being ignored
and actually has meaning if the stack cannot take over
it should return NULL.

Fix both of these situation by being sure to test the
return code and of course in any case of return NULL (there
are 3) make sure we properly reduce the ref count.

Sponsored by: Netflix Inc.
Differential Revision: https://reviews.freebsd.org/D25903

Details

Provenance
rrsAuthored on
Differential Revision
D25903: Leaks of inpcb
Parents
rS363724: MFC r363268:
Branches
Unknown
Tags
Unknown