Page MenuHomeFreeBSD

netfront: fix netfront create_dev error path
ClosedPublic

Authored by liuw_liuw.name on Oct 14 2015, 2:46 PM.
Referenced Files
Unknown Object (File)
Fri, Apr 26, 6:34 AM
Unknown Object (File)
Thu, Apr 25, 8:09 AM
Unknown Object (File)
Thu, Apr 11, 12:05 PM
Unknown Object (File)
Feb 7 2024, 1:38 PM
Unknown Object (File)
Jan 11 2024, 6:56 PM
Unknown Object (File)
Dec 31 2023, 9:36 AM
Unknown Object (File)
Dec 20 2023, 12:46 AM
Unknown Object (File)
Dec 17 2023, 3:53 AM
Subscribers

Details

Reviewers
royger
Group Reviewers
network
Summary

The failure path for allocating rx grant refs should not try to free tx grant refs because tx grant refs were allocated after that.

Don't free tx grant refs twice.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 812
Build 812: arc lint + arc unit

Event Timeline

liuw_liuw.name retitled this revision from to netfront: fix netfront create_dev error path.
liuw_liuw.name updated this object.
liuw_liuw.name edited the test plan for this revision. (Show Details)
liuw_liuw.name added reviewers: royger, network.
liuw_liuw.name set the repository for this revision to rS FreeBSD src repository - subversion.
liuw_liuw.name added a project: network.

I have one comment, LMK what you think.

sys/dev/xen/netfront/netfront.c
1954

IMHO, I would rename this to error and add a KASSERT(err != 0, ("Error path with no error code specified"));

sys/dev/xen/netfront/netfront.c
1954

That's of course fine.

You can do that when you commit this patch if convenient. If you want me to update this patch or send a follow-up, please let me know.

sys/dev/xen/netfront/netfront.c
1925–1926

Is this error case missing:

gnttab_free_grant_references(np->gref_tx_head);
gnttab_free_grant_references(np->gref_rx_head);
liuw_liuw.name edited edge metadata.

Also fix error path for xen_net_read_mac

royger edited edge metadata.
This revision is now accepted and ready to land.Oct 19 2015, 2:47 PM