Page MenuHomeFreeBSD

pf: Simplify cleanup
ClosedPublic

Authored by kp on Mar 10 2021, 3:42 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Feb 23, 1:26 PM
Unknown Object (File)
Dec 23 2023, 4:11 AM
Unknown Object (File)
Dec 20 2023, 3:08 AM
Unknown Object (File)
Dec 14 2023, 10:42 PM
Unknown Object (File)
Dec 5 2023, 8:53 PM
Unknown Object (File)
Oct 8 2023, 4:54 PM
Unknown Object (File)
Sep 4 2023, 8:14 PM
Unknown Object (File)
Aug 16 2023, 9:32 AM

Details

Summary

We can now counter_u64_free(NULL), so remove the checks.

MFC after: 1 week
Sponsored-by: Rubicon Communications, LLC ("Netgate")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kp requested review of this revision.Mar 10 2021, 3:42 PM

Can counter ptr really be NULL is these cases? If yes, I'd rather retain the existing checks as they indicate that this a valid possibility.

Also, counter(9) man page says nothing about the free(NULL) use case.

Can counter ptr really be NULL is these cases? If yes, I'd rather retain the existing checks as they indicate that this a valid possibility.

It can happen, but really only if we fail to allocate memory (see line 520-521).

Also, counter(9) man page says nothing about the free(NULL) use case.

Until D29189 it couldn't handle that. This commit builds on top of that.

In D29190#653711, @kp wrote:

Until D29189 it couldn't handle that. This commit builds on top of that.

May you please stack them together to make this dependency explicit?

In D29190#653711, @kp wrote:

Can counter ptr really be NULL is these cases? If yes, I'd rather retain the existing checks as they indicate that this a valid possibility.

It can happen, but really only if we fail to allocate memory (see line 520-521).

Also, counter(9) man page says nothing about the free(NULL) use case.

Until D29189 it couldn't handle that. This commit builds on top of that.

Yep :-) What I'm saying is that the man page should also be updated to reflect the code changes.

Yep :-) What I'm saying is that the man page should also be updated to reflect the code changes.

Good point. How does D29215 look?

This revision was not accepted when it landed; it landed in state Needs Review.Mar 12 2021, 12:16 PM
Closed by commit rG28dc2c954f50: pf: Simplify cleanup (authored by kp). · Explain Why
This revision was automatically updated to reflect the committed changes.