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
F100206188: D47078.diff
Tue, Oct 15, 12:17 AM
F100085869: D47078.id144682.diff
Mon, Oct 14, 1:39 PM
F100048279: D47078.diff
Mon, Oct 14, 8:31 AM
Unknown Object (File)
Sat, Oct 12, 4:55 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 59962
Build 56847: arc lint + arc unit

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.