Page MenuHomeFreeBSD

uart: uart_getenv: check for NULL class last, not first
ClosedPublic

Authored by imp on Fri, Oct 11, 9:54 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 3, 1:06 PM
Unknown Object (File)
Sun, Nov 3, 12:44 PM
Unknown Object (File)
Mon, Oct 28, 11:31 PM
Unknown Object (File)
Sun, Oct 20, 10:58 PM
Unknown Object (File)
Sun, Oct 20, 10:58 PM
Unknown Object (File)
Sun, Oct 20, 10:58 PM
Unknown Object (File)
Sun, Oct 20, 10:58 PM
Unknown Object (File)
Sun, Oct 20, 10:57 PM
Subscribers
None

Details

Summary

This allows one to specify dt:XXXX when the default class isn't compiled
into the kernel. It's not an error to not have a class until we're done
parsing the spec, so defer checking until then.

Sponsored by: Netflix

Diff Detail

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

Event Timeline

imp requested review of this revision.Fri, Oct 11, 9:54 PM
imp created this revision.
sys/dev/uart/uart_subr.c
293

This is missing a freeenv(cp) in the cleanup path.

Check a little later for NULL class... Doesn't really matter and this fixes the leak markj noticed.

adrian added inline comments.
sys/dev/uart/uart_subr.c
293

is it?

inval: has freeenv(cp); in it.

This revision is now accepted and ready to land.Sun, Oct 13, 10:46 PM
markj added inline comments.
sys/dev/uart/uart_subr.c
293

My comment applied to an older version of the diff. Its location is misleading now, which is a bug/quirk of phabricator.

andrew added inline comments.
sys/dev/uart/uart_subr.c
297–298

We should update this comment while here. Most uart classes are static. Only a few are weak, e.g. the default.

Update the comment too, per Andrew

This revision now requires review to proceed.Mon, Oct 14, 9:11 PM
imp marked 4 inline comments as done.Mon, Oct 14, 9:12 PM
imp added inline comments.
sys/dev/uart/uart_subr.c
297–298

Good idea. Tweaked it a bit.

This revision was not accepted when it landed; it landed in state Needs Review.Mon, Oct 14, 10:18 PM
This revision was automatically updated to reflect the committed changes.
imp marked an inline comment as done.