drivers/network/pcnet: Allocate a small softc on the stack in probe().

Fixes #19372.
This commit is contained in:
Augustin Cavalier 2025-01-25 17:02:45 -05:00
parent 63215dbd2d
commit 3b22516ed2

View File

@ -508,6 +508,11 @@ pcn_probe(dev)
int rid; int rid;
u_int32_t chip_id; u_int32_t chip_id;
#ifdef __HAIKU__
sc = __builtin_alloca(offsetof(struct pcn_softc, pcn_ldata));
device_set_softc(dev, sc);
#endif
t = pcn_match(pci_get_vendor(dev), pci_get_device(dev)); t = pcn_match(pci_get_vendor(dev), pci_get_device(dev));
if (t == NULL) if (t == NULL)
return (ENXIO); return (ENXIO);
@ -529,6 +534,10 @@ pcn_probe(dev)
bus_release_resource(dev, PCN_RES, PCN_RID, sc->pcn_res); bus_release_resource(dev, PCN_RES, PCN_RID, sc->pcn_res);
#ifdef __HAIKU__
device_set_softc(dev, NULL);
#endif
switch((chip_id >> 12) & PART_MASK) { switch((chip_id >> 12) & PART_MASK) {
case Am79C971: case Am79C971:
case Am79C972: case Am79C972: