mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-17 10:26:15 +00:00
Check for malloc return value
This commit is contained in:
parent
1c5fcea18d
commit
2f0275579d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=167219
@ -255,6 +255,8 @@ ixpnpe_attach(device_t dev)
|
||||
|
||||
/* XXX M_BUS */
|
||||
sc = malloc(sizeof(struct ixpnpe_softc), M_TEMP, M_WAITOK | M_ZERO);
|
||||
if (sc == NULL)
|
||||
panic("%s: Cannot allocate softc", device_get_name(dev));
|
||||
sc->sc_dev = dev;
|
||||
sc->sc_iot = sa->sc_iot;
|
||||
mtx_init(&sc->sc_mtx, device_get_nameunit(dev), "npe driver", MTX_DEF);
|
||||
|
Loading…
Reference in New Issue
Block a user