Page MenuHomeFreeBSD

pf: Simplify cleanup
ClosedPublic

Authored by kp on Mar 10 2021, 3:42 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jan 5, 10:12 AM
Unknown Object (File)
Sat, Dec 21, 1:43 PM
Unknown Object (File)
Dec 10 2024, 6:12 PM
Unknown Object (File)
Nov 23 2024, 9:42 AM
Unknown Object (File)
Nov 22 2024, 12:48 PM
Unknown Object (File)
Nov 18 2024, 12:24 AM
Unknown Object (File)
Nov 17 2024, 7:50 PM
Unknown Object (File)
Nov 14 2024, 5:56 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.