mirror of
https://review.haiku-os.org/haiku
synced 2025-02-07 06:16:11 +01:00
drivers/network/pcnet: Allocate a small softc on the stack in probe().
Fixes #19372.
This commit is contained in:
parent
63215dbd2d
commit
3b22516ed2
@ -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:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user