mirror of
https://github.com/opnsense/src.git
synced 2026-06-06 07:12:52 -04:00
cxgb(4): Register ifmedia callbacks before ether_ifattach.
This prevents a panic that occurs if netlink tries to invoke the driver's media callbacks during ifattach. PR: 282374 Reported by: ScottD <biscuits.carry.0j@icloud.com> MFC after: 3 days
This commit is contained in:
parent
f9a039060e
commit
f2daf89954
1 changed files with 5 additions and 5 deletions
|
|
@ -1041,6 +1041,11 @@ cxgb_port_attach(device_t dev)
|
|||
if_sethwassistbits(ifp, 0, CSUM_TSO);
|
||||
}
|
||||
|
||||
/* Create a list of media supported by this port */
|
||||
ifmedia_init(&p->media, IFM_IMASK, cxgb_media_change,
|
||||
cxgb_media_status);
|
||||
cxgb_build_medialist(p);
|
||||
|
||||
ether_ifattach(ifp, p->hw_addr);
|
||||
|
||||
/* Attach driver debugnet methods. */
|
||||
|
|
@ -1055,11 +1060,6 @@ cxgb_port_attach(device_t dev)
|
|||
return (err);
|
||||
}
|
||||
|
||||
/* Create a list of media supported by this port */
|
||||
ifmedia_init(&p->media, IFM_IMASK, cxgb_media_change,
|
||||
cxgb_media_status);
|
||||
cxgb_build_medialist(p);
|
||||
|
||||
t3_sge_init_port(p);
|
||||
|
||||
return (err);
|
||||
|
|
|
|||
Loading…
Reference in a new issue